-Matt- Posted May 26, 2008 Posted May 26, 2008 If($_GET['action'] == '1day') { $db->query("UPDATE users SET haha=haha+1 WHERE userid=".$ir['userid']); $db->query("UPDATE users SET money=money-200 WHERE money>=200 AND userid=".$ir['userid']); $db->query("UPDATE users SET lol=24 WHERE userid=".$ir['userid']); Echo ' <h1>**********************</h1>'; $h->endpage(); exit; } well the bug is that when your money is 0 you refresh and it puts haha+1 still when it takes 0 money away. as it does not go past 0 but still puts it up any help? Quote
Isomerizer Posted May 26, 2008 Posted May 26, 2008 Re: error bug help :p if($_GET['action'] == '1day') { if ($ir['money'] > 199) { $db->query("UPDATE `users` SET `money` = `money` - 200, `haha` = `haha` + 1 WHERE `userid` = ".$ir['userid']." "); } $db->query("UPDATE `users` SET `lol` = 24 WHERE `userid` = ".$ir['userid']." "); echo ' <h1>**********************</h1>'; $h->endpage(); exit; } Quote
AlabamaHit Posted May 27, 2008 Posted May 27, 2008 Re: error bug help :p Do you mean if they ahve 0 money they can still do it? IF so try this.. if($_GET['action' == '1day' && $ir['money'] > 199) { $db->query("UPDATE users SET money = money-200, haha = haha+1, lol = 24 WHERE userid = ".$ir['userid']." "); echo ' <h1>********************</h1>'; $h->endpage(); exit; } else { echo 'You do not have the funds'; $h->endpage(); exit; } Or you can go this way to... at the top of page....add this so if there money is Not greater than 200 they can not even view the page. if($ir['money'] < 200) { echo 'Leave you broke bum....'; $h->endpage(); exit; } If I mis understood the error you need to explain a little better :) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.