Chevy Posted July 15, 2006 Share Posted July 15, 2006 I got it now, thanks anyway!! Quote Link to comment https://forums.phpfreaks.com/topic/14701-solved-only-pay-1-time-during-session/ Share on other sites More sharing options...
Chevy Posted July 15, 2006 Author Share Posted July 15, 2006 This is really bugging me so if you could reply that would be great :) Quote Link to comment https://forums.phpfreaks.com/topic/14701-solved-only-pay-1-time-during-session/#findComment-58663 Share on other sites More sharing options...
pixy Posted July 15, 2006 Share Posted July 15, 2006 Patience is a virtue, young grasshopper.Try this...[code]<?phpif ($_SESSION['paid'] != 'yes'){ if ($points != 0) { exit('You do not have enough points.'); } else { $query = "UPDATE table SET points='$points' WHERE username='$Myusername'"; $result = mysql_query($query); if (!$result) { die(mysql_error()); } $new_query = "UPDATE table SET paid='yes' WHERE username='$Myusername'"; $new_result = mysql_query($new_result); if (!$new_result) { die(mysql_error()); } }}?>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/14701-solved-only-pay-1-time-during-session/#findComment-58669 Share on other sites More sharing options...
Chevy Posted July 15, 2006 Author Share Posted July 15, 2006 Thank you! I actually like that one better tan mine now :) Quote Link to comment https://forums.phpfreaks.com/topic/14701-solved-only-pay-1-time-during-session/#findComment-58682 Share on other sites More sharing options...
pixy Posted July 15, 2006 Share Posted July 15, 2006 Use this: (I accidently made it so that if $point wasn't equal to zero, it tells you "not enough", instead of if it was equal to zero.[code]<?phpif ($_SESSION['paid'] != 'yes'){ if ($points == 0) { exit('You do not have enough points.'); } else { $query = "UPDATE table SET points='$points' WHERE username='$Myusername'"; $result = mysql_query($query); if (!$result) { die(mysql_error()); } $new_query = "UPDATE table SET paid='yes' WHERE username='$Myusername'"; $new_result = mysql_query($new_result); if (!$new_result) { die(mysql_error()); } }}?>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/14701-solved-only-pay-1-time-during-session/#findComment-58684 Share on other sites More sharing options...
Chevy Posted July 15, 2006 Author Share Posted July 15, 2006 Yea I noticed it and fixed it before it works good Quote Link to comment https://forums.phpfreaks.com/topic/14701-solved-only-pay-1-time-during-session/#findComment-58691 Share on other sites More sharing options...
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.