Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

whats wrong with this php?

  • 09-02-2008 04: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, Registered Users 2 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