Jump to content

Can't get this to work.


jack bro

Recommended Posts

if ($currentime > $endtime){
$winner = rand(1,$winner);
$winz=mysql_fetch_object(mysql_query("SELECT * FROM lotto WHERE id='$winner'"));
$winner_stuff=mysql_fetch_object(mysql_query("SELECT * FROM users WHERE username='$winz->owner'"));

mysql_query("UPDATE users SET money = money+'$lotto_info->jackpot' WHERE username='$winz->owner'");

$time = time() +(86400 * 3);
$new_num =$lotto_inf->lotto_num + 1;
mysql_query("UPDATE lotto_info SET lotto_num = '$new_num', time_to='$time', winning_ticket='$winner', winner='$fetch_win->username', jackpot='0'");
mysql_query("TRUNCATE TABLE lotto");
}

 

$currenttime=time();
$endtime=$lotto_inf->time_to;

 

Current database:

 

`lotto_info` (`id`, `price`, `time_to`, `jackpot`, `lotto_num`, `winning_ticket`, `winner`) VALUES
(1, 5000, 1239234730, 10055000, 1, 1, '');

 

Some reason it isn't starting a new lottery.

 

Thanks,

 

Jack.

 

Link to comment
https://forums.phpfreaks.com/topic/153248-cant-get-this-to-work/
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.