Jump to content


Photo

SOLVED!!! Only pay 1 time during session??


  • Please log in to reply
5 replies to this topic

#1 Chevy

Chevy
  • Members
  • PipPipPip
  • Advanced Member
  • 163 posts

Posted 15 July 2006 - 08:36 PM

I got it now, thanks anyway!!

#2 Chevy

Chevy
  • Members
  • PipPipPip
  • Advanced Member
  • 163 posts

Posted 15 July 2006 - 09:03 PM

This is really bugging me so if you could reply that would be great :)


#3 pixy

pixy
  • Members
  • PipPipPip
  • Advanced Member
  • 295 posts

Posted 15 July 2006 - 09:17 PM

Patience is a virtue, young grasshopper.
Try this...
<?php
if ($_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());
        }
    }
}
?>

This is a .44 Caliber Loveletter straight through my heart.

Tabulas + Threadless + Hire Me!


#4 Chevy

Chevy
  • Members
  • PipPipPip
  • Advanced Member
  • 163 posts

Posted 15 July 2006 - 09:29 PM

Thank you! I actually like that one better tan mine now :)

#5 pixy

pixy
  • Members
  • PipPipPip
  • Advanced Member
  • 295 posts

Posted 15 July 2006 - 09:31 PM

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.

<?php
if ($_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());
        }
    }
}
?>

This is a .44 Caliber Loveletter straight through my heart.

Tabulas + Threadless + Hire Me!


#6 Chevy

Chevy
  • Members
  • PipPipPip
  • Advanced Member
  • 163 posts

Posted 15 July 2006 - 09:52 PM

Yea I noticed it and fixed it before it works good




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users