manalnor Posted August 13, 2011 Share Posted August 13, 2011 Hello dear friends, I know that i can write it for MYSQL database as $qry="select names from tools order by RAND()"; $result=mysql_query($qry) or die($qry); My question how can i may it random in certain range for example show 4 " names" in random way in range of "1" to "10" order by id ? to to write it in another way i ask about random "RAND()" in certain range How ! Thanks Link to comment https://forums.phpfreaks.com/topic/244695-how-to-use-rand/ Share on other sites More sharing options...
jcbones Posted August 13, 2011 Share Posted August 13, 2011 All about RAND() Link to comment https://forums.phpfreaks.com/topic/244695-how-to-use-rand/#findComment-1256829 Share on other sites More sharing options...
voip03 Posted August 13, 2011 Share Posted August 13, 2011 $qry="select names from tools where id='". rand(1, 10)."';"; Link to comment https://forums.phpfreaks.com/topic/244695-how-to-use-rand/#findComment-1256835 Share on other sites More sharing options...
manalnor Posted August 13, 2011 Author Share Posted August 13, 2011 @jcbones thank you for this reference very helful @voip03 very nice idea Link to comment https://forums.phpfreaks.com/topic/244695-how-to-use-rand/#findComment-1256841 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.