jack bro Posted April 8, 2009 Share Posted April 8, 2009 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 More sharing options...
taquitosensei Posted April 9, 2009 Share Posted April 9, 2009 you need to post the code for the lotto_inf class for anyone to be able to figure out what's wrong Link to comment https://forums.phpfreaks.com/topic/153248-cant-get-this-to-work/#findComment-805079 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.