Jump to content

php random number


Jiraiya

Recommended Posts

here is the code

it displays a random number but doesn't update the variable

 

 

$username = $_COOKIE['ID_my_site']; 
$sql = mysql_query("SELECT * FROM users WHERE username = '$username'") or die(mysql_error());

echo (rand(1,10));
$var = rand(1, 10);
$sql = "SELECT * FROM users WHERE number = '$var'";
mysql_query($sql) or die(mysql_error());



?>

Link to comment
https://forums.phpfreaks.com/topic/153007-php-random-number/#findComment-803623
Share on other sites

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.