Jump to content

Random Number Function?


Solarpitch

Recommended Posts

$selectHigh = "SELECT * FROM table ORDER BY id DESC";
$selectLow = "SELECT * FROM table ORDER BY id ASC";
$queryHigh = mysql_query($selectHigh) or die(mysql_error());
$queryLow= mysql_query($selectLow ) or die(mysql_error());
$high = msyql_fetch_assoc($queryHigh);
$low= msyql_fetch_assoc($queryLow);

srand ((double) microtime( )*1000000);
$random_number = rand($low['id'],$high['id']);
echo "$random_number";

 

something like that

Archived

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

×
×
  • Create New...

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.