Chevy Posted July 15, 2006 Share Posted July 15, 2006 I got it now, thanks anyway!! 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 :) 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] 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 :) 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] 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 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
Archived
This topic is now archived and is closed to further replies.