Dysan Posted April 29, 2008 Share Posted April 29, 2008 Hi, I have a database, containing people's names, ages, and gender's. How do I randomly display a different persons record, upon refreshing the page? Link to comment https://forums.phpfreaks.com/topic/103393-display-random-data/ Share on other sites More sharing options...
zenag Posted April 29, 2008 Share Posted April 29, 2008 $row =mysql_query("SELECT * FROM tablename ORDER BY rand()"); Link to comment https://forums.phpfreaks.com/topic/103393-display-random-data/#findComment-529478 Share on other sites More sharing options...
JSHINER Posted April 29, 2008 Share Posted April 29, 2008 Try this: <?php $sql = "SELECT * FROM tablename ORDER BY RAND() LIMIT 1"; ?> Link to comment https://forums.phpfreaks.com/topic/103393-display-random-data/#findComment-529479 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.