>From the German php FAQ:
version >= 3.23
SELECT * FROM tabelle ORDER BY RAND() LIMIT 1
version < 3.23
//see how many rows you have
$result = @mysql_query("SELECT COUNT(*) FROM $table");
$row = mysql_fetch_row($result);
//produce random number out of that
mt_srand((double)microtime()*100)
>From the German php FAQ:
version >= 3.23
SELECT * FROM tabelle ORDER BY RAND() LIMIT 1
version < 3.23
//see how many rows you have
$result = @mysql_query("SELECT COUNT(*) FROM $table");
$row = mysql_fetch_row($result);
//produce random number out of that
mt_srand((double)microtime()*100)
- Original Message -
From: Derick Dorner
To: [EMAIL PROTECTED]
Sent: Tuesday, July 17, 2001 3:11 PM
Subject: tricky RAND() function...
I am using MySQL 3.22, and need to know how to randomly select a record, therefore I
can't just use the ORDER BY RAND() clause, because of my versio