Jump to content


Photo

RANDOM [solved]


  • Please log in to reply
2 replies to this topic

#1 jaymc

jaymc
  • Members
  • PipPipPip
  • Advanced Member
  • 1,521 posts
  • LocationLiverpool

Posted 26 August 2006 - 01:03 PM

Here is the query im running to select 100 mobile numbers from a database

$query = "SELECT * FROM `ibf_members` WHERE `mobilenum` !=NULL LIMIT 0,100";

However, I want to to select 100 at random, not the first 100 in the table

How can I achieve that?
I would love to change the world, but they won't give me the source code

SEO Agency

#2 shocker-z

shocker-z
  • Members
  • PipPipPip
  • Advanced Member
  • 864 posts
  • LocationNottingham

Posted 26 August 2006 - 01:06 PM

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 :)
www: www.ukchat.ws | irc: irc.ukchat.ws chan: #blufudge

#3 jaymc

jaymc
  • Members
  • PipPipPip
  • Advanced Member
  • 1,521 posts
  • LocationLiverpool

Posted 26 August 2006 - 01:17 PM

Cheers ! That worked a treat
I would love to change the world, but they won't give me the source code

SEO Agency




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users