You are here: Mysql recordset help « PHP Language « IT news, forums, messages
Mysql recordset help

Posted by Jon on 09/21/05 19:51

Hello,

I'm currently working on a photo gallery project that is requiring quite a
bit of PHP/mySQL and am having trouble. Right now, I have a program that is
bringing in records from the DB, and using a 'next' button to cycle through
those records. Currently, the record I'm obtaining is running off of an
incrementing variable (nextImage) . I'm able to increment the nextImage
variable, and link through each record in the DB while moving to the next
using one link on the page.

The problem - I now need to have the recordset I'm grabbing from the DB be
based off of a Category ID - Each image has a catID associated with it (in
the same table as a FK). My problem is that as I'm incrementing the
nextImage variable by 1 each time which is used to call the next photoID,
the query fails when I reach a photoID with a catID that's not specified.

My question is: How can I cycle through a recordset of data from the DB,
without knowing what the next ID will be? Right now, I can say "SELECT *
FROM table WHERE catID = $variable" - however, I need to move through each
record in this query via an HTML link - so when the user clicks 'Next', it
needs to not go to 'currentImage + 1' for example, but it needs to move to
the actual next value in our recordset.

Any help is appreciated, thank you in advance.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация