note 48544 deleted from function.rand by felipe
| From: | felipe@php.net | Date: | Sun, 09 Dec 2007 15:35:11 +0000 |
| Subject: | note 48544 deleted from function.rand by felipe | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-133054@lists.php.net to get a copy of this message | ||
Note Submitter: Janus - palacecommunity dot com
----
Or you could do!:
$rnd = mysql_result(mysql_query("SELECT FLOOR(RAND() * COUNT(*)) FROM
table (WHERE
condition)"));
mysql_query("SELECT * FROM table (WHERE condition`) LIMIT {$rnd},1");