Re: Fw: tricky RAND() function...

2001-07-20 Thread Werner Stuerenburg
>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)

Re: Fw: tricky RAND() function...

2001-07-20 Thread Werner Stuerenburg
>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)