jaymc Posted August 26, 2006 Share Posted August 26, 2006 Here is the query im running to select 100 mobile numbers from a database[b]$query = "SELECT * FROM `ibf_members` WHERE `mobilenum` !=NULL LIMIT 0,100";[/b]However, I want to to select 100 at random, not the first 100 in the tableHow can I achieve that? Quote Link to comment https://forums.phpfreaks.com/topic/18718-random-solved/ Share on other sites More sharing options...
shocker-z Posted August 26, 2006 Share Posted August 26, 2006 this should work$query = "SELECT * FROM `ibf_members` WHERE `mobilenum` !=NULL ORDER BY RAND() LIMIT 0,100";just sumet i read on the net once :) Quote Link to comment https://forums.phpfreaks.com/topic/18718-random-solved/#findComment-80706 Share on other sites More sharing options...
jaymc Posted August 26, 2006 Author Share Posted August 26, 2006 Cheers ! That worked a treat Quote Link to comment https://forums.phpfreaks.com/topic/18718-random-solved/#findComment-80712 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.