By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,963 Members | 920 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,963 IT Pros & Developers. It's quick & easy.

next article

P: n/a
Hello,

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.

Bob
Jul 17 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Bob Bedford wrote:
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 ?
If this is normal page, you could use mysql_data_seek(). But, in
your case, it won't suit.
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.

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/

Jul 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.