Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

whats wrong with this php?

Options
  • 09-02-2008 4:12pm
    #1
    Closed Accounts Posts: 94 ✭✭


    if ($newimpressions2== "10") {

    $newbalance=$oldbalance+1;
    $q="UPDATE `**********`.`****` SET `balance` = $newbalance WHERE `****`.`userid` =$userid LIMIT 1";
    $r=mysql_query($q);
    $newimpressions2="0";

    }


    what it should do is check if $newimpressions2 is = 10 then run that mysql.

    what happens is it always runs the sql......

    whats wrong with this?

    EDIT: solved it it should be
    if ($newimpressions2 == "10") {


Comments

  • Registered Users Posts: 9,579 ✭✭✭Webmonkey


    Yep, if you had a single equal sign , this meant you were assigning the value to it and that operation results in a true, hence why you entered the loop.


Advertisement