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
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

whats wrong with this php?

  • 09-02-2008 3: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