Woodburn2006 Posted May 10, 2008 Share Posted May 10, 2008 how would i grab a random result from a DB? i have a DB full of stuff for my portfolio and i want to grab a random row from the DB to display on a page so that everytime the page is loaded it grabs a random result to display. is there a way of doing this? Link to comment https://forums.phpfreaks.com/topic/105079-random-image/ Share on other sites More sharing options...
BlueSkyIS Posted May 10, 2008 Share Posted May 10, 2008 SELECT image FROM some_table ORDER BY RAND() LIMIT 1; Link to comment https://forums.phpfreaks.com/topic/105079-random-image/#findComment-537908 Share on other sites More sharing options...
Fadion Posted May 10, 2008 Share Posted May 10, 2008 BlueSkyIS gave u the answer, but this is a question that google can answer it easily. I searched for "php mysql random row" and the very first page gives the right code. Link to comment https://forums.phpfreaks.com/topic/105079-random-image/#findComment-537910 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.