Jump to content

Archived

This topic is now archived and is closed to further replies.

jaymc

RANDOM [solved]

Recommended Posts

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 table

How can I achieve that?

Share this post


Link to post
Share on other sites
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 :)

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.