web_master Posted November 17, 2009 Share Posted November 17, 2009 Hi, I want to list users, but randomly on every pageload and only 9 users, how can I do that? <?php // Reload from dBase $QueryReturn = mysql_query( 'SELECT * FROM `user` WHERE `user_onoff` = "1" AND `user_delete` = "0" ' ); // Check query if ( !$QueryReturn ) { echo mysql_error(); exit; } // Request query while ( $REQUEST = mysql_fetch_array ( $QueryReturn ) ) { $REQUEST['user_nick']; } ?> Thanks in advanced T Quote Link to comment https://forums.phpfreaks.com/topic/181852-solved-random-query/ Share on other sites More sharing options...
MadTechie Posted November 17, 2009 Share Posted November 17, 2009 Add to SQL ORDER BY RAND() LIMIT 9 Quote Link to comment https://forums.phpfreaks.com/topic/181852-solved-random-query/#findComment-959101 Share on other sites More sharing options...
web_master Posted November 17, 2009 Author Share Posted November 17, 2009 Add to SQL ORDER BY RAND() LIMIT 9 Ist work, thanx MadTechie! T Quote Link to comment https://forums.phpfreaks.com/topic/181852-solved-random-query/#findComment-959113 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.