Jump to content
MakeWebGames

error bug help :p


-Matt-

Recommended Posts

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?

Link to comment
Share on other sites

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;
}
Link to comment
Share on other sites

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 :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...