RE: [PHP-DB] Random Selecting from mySQL
| From: | Gurhan Ozen | Date: | Wed, 13 Mar 2002 19:14:34 +0000 |
| Subject: | RE: [PHP-DB] Random Selecting from mySQL | ||
| References: | 1 | Groups: | php.db php.general |
| Request: | Send a blank email to php-db+get-17656@lists.php.net to get a copy of this message | ||
are you just looking for a way to display 10 results per page? If yes then
you can just use LIMIT to limit your result to 10 .. So, for the first page,
you can do "SELECT .... LIMIT 1, 10;" and for the second page "SELECT ...
LIMIT 11, 20" etc etc .
You can sure use "ORDER BY" with "LIMIT" to to sort the results for a
given criteria ..
Gurhan
-----Original Message-----
From: Georgie Casey [mailto:webmaster@filmfind.tv]
Sent: Wednesday, March 13, 2002 2:00 PM
To: php-db@lists.php.net; php-general@lists.php.net
Subject: [PHP-DB] Random Selecting from mySQL
I know how to use the "ORDER BY rand()" command on the end of queries to
randomize selection, but that's no good when you want to only display 10
results per page. The next page the user chooses, randomizes again and could
show duplicate fields and not at all show other fields.
Does anyone know a way round this?
--
Regards,
Georgie Casey
webmaster@filmfind.tv
***************************
http://www.filmfind.tv
Ireland's Online Film Production Directory
***************************
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php