RE: [PHP] random order
| From: | David Freeman | Date: | Sun, 12 May 2002 22:03:54 +0000 |
| Subject: | RE: [PHP] random order | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-97260@lists.php.net to get a copy of this message | ||
> I have a mysql databse with 4 rows, and each row (row1,
> row2, row3, and row4)
> contains a sentence. now i want these sentences to appear in
> random order:
I've always found mysql's RAND() function to be of use. Specifically:
SELECT * FROM MyTable WHERE Some='Condition' ORDER BY RAND() LIMIT 4
CYA, Dave