next article

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

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.


Re: next article

Bob Bedford wrote:
Quoted text here. Click to load it
articles per
may I

If this is normal page, you could use mysql_data_seek(). But, in
your case, it won't suit.

Quoted text here. Click to load it

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: /

Site Timeline