/ Published in: SQL
Using subqueries...
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
SELECT name FROM tablename WHERE id >= FLOOR( RAND( ) * ( SELECT MAX( id ) FROM tablename ) ) ORDER BY id ASC LIMIT 1
URL: http://www.phpfreaks.com/forums/index.php?topic=125759.0