Jump to content

HELP... I want to jump to the middle of a recordset, from a different page.


vinylguru

Recommended Posts

I have a recordset on my index page that calls the 20  most recent pics inserted in my DB.  I want to put a link on each picture so when someone clicks on it, It will send them to my photos page where I will display one picture at time, and have recordset navigation to move forward, back, first, or last.  The recordset on my photo page calls all records in my DB, but limits the query based on the date inserted. 

 

So if someone clicks on picture_id=40 on my index page... I want to jump to that page in my recordset on my photos page. How can I find what page that record is on, and move my pointer there? can I do it with  msql_data_seek()? Is it possible to use this with a variable?  Thank you in advance. It seems like it should be simple, but its killing me. here is an example of what I'm trying to do.

 

http://www.pearljam.com/  (click on one of the photos, and your redirected to the middle of the recordset)

Not shure what you mean. You are selecting the top 20 records. displaying thumb nail images of them. someone wants to click on an image and is taken to a page that shows the larger image.

 

Now you want to move forward and back first and last as well. Is this what you are after?

 

Desmond.

 

so, what i think u wanted is like a ranking

like a game, that has so many characters with different levels

u want to order them in desc based on level  order, and u want to find the characters that is like level 20, ie, it is on page 33.

this what u mean?

and u show the next few chars, like level 19, level 18

 

or u want something like pagination?

if it is pagination, it is easy, i believe there are pretty much topics on this

 

if it is like ranking, and if u never deleted anything, meanings, id from 1 to 100 all there, without anything missing

and u dont allow delete, this is simple, just do calculation

 

if u allow delete, the code is much more complicate, if u want performance

$number_per_page=10
select count(*)/$number_per_page+1 as page_num from pics where picture_id<=40

thiis finds which page the picture is at, if u want asc order

then u can use pagination method to go to that page

 

Yes, that is what I'm trying to do, but on detail page, It calls all of the records from my DB table, and I want to jump to the page that is displaying the picture that they clicked to go to the detail page.

 

Thanks

Archived

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

×
×
  • Create New...

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.