Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Bob Bedford
January 14, 2005, 3:27 pm
rate this thread
I've a search engine on my e-commerce website that returns 10 articles per
page. Actually, the customer may make a search, click on any article result
then come back to the list and click on an other article.
I'd like to provide a "next article" and "previous article" button: this
will let the customer browse all articles without the need to come back
everytime for clicking on the article list. Since I use MySQL, how may I
know which is the next available item depending on the query result ? With
my knowledge, I'm thinking to put all query results (article ID) in an
array, and pass it as parameter, but this isn't probably the best way.
- R. Rajesh Jeba Anbiah
January 15, 2005, 4:55 pm
Re: next article
If this is normal page, you could use mysql_data_seek(). But, in
your case, it won't suit.
IMHO, your such caching mechanism seems to be the better way.
Probably putting the result array of article IDs in one $result_arr and
serializing+base64_encoding it, and the passing via hidden field may
help. May also cache the result array in session, but that would be
sometimes a mess.
<?php echo 'Just another PHP saint'; ?>
Email: rrjanbiah-at-Y!com Blog: http://rajeshanbiah.blogspot.com /