Jump to content

RAND()


mcmuney

Recommended Posts

There is no good way of doing that.  The purpose of using RAND() is to get a different sort order each time.

The only thing I can think of off hand would be to do your query, then store the result somewhere...in a session, or in a file, so that when the user goes to the next page you are able to retrieve the same result set and get the next 10 records for them to view.
Link to comment
https://forums.phpfreaks.com/topic/17087-rand/#findComment-72175
Share on other sites

According to the manual, you can:

http://mysql.com/doc/refman/5.0/en/mathematical-functions.html#id3220613

Which means that all he would have to do is get a random number, use it so seed mysql's RAND function, then store that number in a session to be used in all subsequent queries.

Good suggestion.
Link to comment
https://forums.phpfreaks.com/topic/17087-rand/#findComment-72187
Share on other sites

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.