Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Displaying data from a recordset

New Here ,
Aug 30, 2006 Aug 30, 2006
Hi

I have created a recordset and it returns 6 rows of data when tested. These are products for an on-line catelogue and I would like to do is display 6 products per page. I have created 6 areas and added the data dynamically and what happens is that the first row of data is displayed 6 times. Is there any way to display all the rows on one page? I have read the 'Recordset paging and move to next page' and I can get this to work but what I need is to display 6 products on one page. I am using PHP and MySQL with Dreamweaver. Presumably it something to do with $mysql_num_row but is there a simple way in Dreamweaver to do this? If not does anyone know the PHP syntax to get this working?

Hope you can help me.

Regards

Nikki
TOPICS
Server side applications
366
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Aug 30, 2006 Aug 30, 2006
On Wed 30 Aug 2006 04:23:37p, Nikki Cade wrote in
macromedia.dreamweaver.appdev:

> I have created a recordset and it returns 6 rows of data when tested.
> These are products for an on-line catelogue and I would like to do
> is display 6 products per page. I have created 6 areas and added the
> data dynamically and what happens is that the first row of data is
> displayed 6 times. Is there any way to display all the rows on one
> page? I have read the 'Recordset paging and move to next page' an...
Translate
LEGEND ,
Aug 30, 2006 Aug 30, 2006
Do you ahve a page? YOu're tryign to display all six product, correct? If
you can show an url it might help. You eithger just need to go tothe
applications panel, server behaviors and Repeate Region, or you need to
start over. If start over, read through quickly below and comment.

what I liek to do is a little different, but you can drag and drop
everything.

What I do is define what variables I'm goign to be using:

$pID = (you can drag your field here or type it)
$row_Recordset['FieldNameID'];
$pName = rs['Name'] (same stuff as above, either drag and drop or just type
$pDescription
$pPrice
$pwhatever else

Then, what you should do is setup your HTML structure:

<table>
<tr>
<td>$pName</td>
<td>$pDescrioption</td>
<td>$pPrice</td>
</tr>
</table>

Next, switch to split view and select the row you just put in there.
Then head over to your applications panel, and in Server Behaviors select
"repeat region".
Repeat all, or repeat a number of times. Since it's a product listing, if
you do a limited number of time syou're going to need recordset paging. In
this example, I recommend all.

That should be all you need to do.

HTH,

JOn

"Nikki Cade" <webforumsuser@macromedia.com> wrote in message
news:ed4s49$l13$1@forums.macromedia.com...
> Hi
>
> I have created a recordset and it returns 6 rows of data when tested.
> These
> are products for an on-line catelogue and I would like to do is display
> 6
> products per page. I have created 6 areas and added the data dynamically
> and
> what happens is that the first row of data is displayed 6 times. Is there
> any
> way to display all the rows on one page? I have read the 'Recordset paging
> and
> move to next page' and I can get this to work but what I need is to
> display 6
> products on one page. I am using PHP and MySQL with Dreamweaver.
> Presumably it
> something to do with $mysql_num_row but is there a simple way in
> Dreamweaver to
> do this? If not does anyone know the PHP syntax to get this working?
>
> Hope you can help me.
>
> Regards
>
> Nikki
>


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 30, 2006 Aug 30, 2006
On Wed 30 Aug 2006 04:23:37p, Nikki Cade wrote in
macromedia.dreamweaver.appdev:

> I have created a recordset and it returns 6 rows of data when tested.
> These are products for an on-line catelogue and I would like to do
> is display 6 products per page. I have created 6 areas and added the
> data dynamically and what happens is that the first row of data is
> displayed 6 times. Is there any way to display all the rows on one
> page? I have read the 'Recordset paging and move to next page' and I
> can get this to work but what I need is to display 6 products on one
> page. I am using PHP and MySQL with Dreamweaver. Presumably it
> something to do with $mysql_num_row but is there a simple way in
> Dreamweaver to do this?

Instead of putting 6 regions on one page, put a single region, and populate
it with fields from the database. Then select the entire region, including
any container, and add a repeat region. Tell it you want 6 records per
page. Then you can add recordset paging.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 31, 2006 Aug 31, 2006
LATEST
Hi

Thank you to both of you for the replies. I used Joe's method in the end and changed the layout on my original page and now everything is working well.

Thanks

Nikki
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines