Reply
display a certain record from a display of multiple results
Old 02-02-2007, 02:09 PM display a certain record from a display of multiple results
Average Talker

Posts: 27
Trades: 0
Hi all,

I am just designing a photo gallery site that stores each image as a record within a mysql database.

My main page for each particular shoot displays the thumbnail images of every record/(image) within that gallery. The images on this page have been filtered by the gallery name in the database which is a field in the database.

Each thumbnail, when clicked will then link to a new page which displays the large image. When the thumbnail is clicked, it passes the parameter of the gallery name and the image thumnail reference (both these are stored in the same table).

To create a recordset of all the images to be displayed, it is filtered by the gallery same from the url parameter so that all the same images are selected.

I then display each image using a repeated region in Dreamweaver set to 1 record per page so that only one record/(image) is shown per page, and to then view the previous or next image, it is done by a link that uses the Move To Next (or previous) Page behaviour.

This now gives me the ability to view images one at a time and the next or previous one can be viewed by clicking a link that navigates to the next record.

What this does do though by default is display the first record, and what I would like it to do is when the thumbnail is clicked, it loads the large images page and shows the image of the thumbnail that was clicked. For example, if I clicked a thumbnail called 0050.jpg halfway through the record set, it would then load the large image page and display the large image of 0050.jpg and keep the ability to navigate next or previous to either 0051.jpg or 0049.jpg. Therefore in effect, the image displayed is the one selected (from the url parameter in this case) and not reverted to the first one in the recordset each time.

Any ideas how to get round this?
gavrd1 is offline
Reply With Quote
View Public Profile
 
 
When You Register, These Ads Go Away!
Old 02-02-2007, 09:09 PM Re: display a certain record from a display of multiple results
floridian's Avatar
Novice Talker

Posts: 9
Name: Sergey
Location: Florida
Trades: 0
Hi,

If I understand you correctly, you pull recordset from a galery with many records, then
you want to find one record that pull the image with the same number as thumbnail image.
You not specify what kind database you use. If it is MySQL then you can load each field
value in array. For example you have field1, field2, field3 in the record
then you create array1[], array2[], array[3]. When arrays populate from
$count=0
while($row=mysql_fetch_row($result))
{
$field1[$count]=$row[0];
$field2[$count]=$row[1];
$field3[$count]=$row[2];

$count = $count+1;
}
Then you look for 0050.jpg in field1[] array and when you find it, take the index.
all the other fields values for the same record could be found in field2 and field3 array cell with the same index (if each fields in each row has value in table)

If it is different database like MS ACESS, maybe there is recorset.find <criteria> method?
__________________
Sergey
http://www.configure-all.com

Last edited by floridian; 02-02-2007 at 09:11 PM..
floridian is offline
Reply With Quote
View Public Profile Visit floridian's homepage!
 
Old 02-08-2007, 01:09 PM Re: display a certain record from a display of multiple results
memberpro's Avatar
Super Talker

Posts: 143
Trades: 0
Since we are talking about recordsets, I am assuming we are dealing with an Access database.

If that is the case, then when you pull a record set and start scrolling through it, there is an internal pointer that keeps track of where you are in the recordset. It sounds like somehow the program is resetting the internal pointer.

That can happen when you re-query the database using the same id of the current recordset. When you pull up the larger picture file, does it do the same query on the database? Make sure that this isn't the case.

You can also record the location of the internal pointer before you pull up the larger version of the picture. Simply pass this variable onto the recordset after the picture is pulled up and you should be in the same location.

Best of luck.
__________________
Membership Mastery Videos - step-by-step learn how to design, create and install your own website in hours...not days. Web Site Design was never so easy.
memberpro is offline
Reply With Quote
View Public Profile
 
Old 02-08-2007, 04:18 PM Re: display a certain record from a display of multiple results
Learning Newbie's Avatar
Defies a Status

Latest Blog Post:
Astounding Republican Paranoia
Posts: 5,674
Name: John Alexander
Trades: 0
Quote:
Originally Posted by memberpro View Post
Since we are talking about recordsets, I am assuming we are dealing with an Access database.

He said: "I am just designing a photo gallery site that stores each image as a record within a mysql database."
Learning Newbie is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to display a certain record from a display of multiple results
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.09508 seconds with 13 queries