Jump to content

Archived

This topic is now archived and is closed to further replies.

Hello There!

Browsing a recordset starting at random record?

Recommended Posts

Hi, I'm using mysql / php / dreamweaver mx2004. My website currently shows a list of products, each of which can be seen in detail in a popup window. When the product is clicked a URL parameter of the product's unique PRODUCT NUM is passed to the pop up and the appropriate dertails are displayed. What i want to do is have a next button in the popup window that will automatically show the details of the next product i.e PRODUCT NUM + 1 in the product table, rather than having to close the popup and choose another item from the main list.

 

There are 2 ways i thought of doing this:

 

First was 2 use a repeat region and show each product 1 at a time. The trouble with this is that i could not figure a way start the repeat region behaviour from a certain point in the recordset - it always starts at the beginning. Is there any way to create a repeat region and specify the starting record?

 

Secondly was to take the PRODUCT NUM and add a counter so it would go up by one every time the next button in the popup was clicked and that number passed as URL param to pick up the right details when the pop up is reloaded. Trouble with this is I can't figure out how to set up the count and declare the variable a URL param. I presume you use javascript but how to use a js variable as a URL param? do you just use the var name? I tried setting up calling the PRODUCT NUM of the current record as URL param and putting +1 on the end. This did not work and i got this error:

 

You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '1 LIMIT -1' at line 1

 

So, I'm having some problems! Am i missing something really simple here? Is there another way? I'm quite new to websites and dreamweaver's been holding my hand for a while now but I'm flummoxed. Any help or advice would be much appreciated!

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.