Random

From: Date: Fri, 31 Aug 2001 18:17:37 +0000
Subject: Random
Groups: php.db 
Request: Send a blank email to php-db+get-12049@lists.php.net to get a copy of this message
I would like to get the first 5 random entries out of my "mysql" database, what would be the correct SELECT option? I adjusted this line $result = mysql_db_query ("$DBName","select * from Contacts LIMIT 0,5 "); which works correctly. :) $result = mysql_db_query ("$DBName","select * from Contacts order by rand() LIMIT 5 "); Doesn't work at all. :( Can anyone through any light on this subject. Thanks.

« previous php.db (#12049) next »