whiteboikyle Posted July 8, 2008 Share Posted July 8, 2008 okay well i am trying to make a mysql get the users rank and -3.. is there a way to do it using mysql? like i tried `rank`=`rank`-3 but it didn't work.. also how do i make it SET 2 different things.. Here is my full mysql UPDATE `members` SET `disabled` = '0' and `rank` = `rank-3 WHERE username = 'test' but the `rank` never updates? anyways.. thanks in advanced Quote Link to comment Share on other sites More sharing options...
lemmin Posted July 8, 2008 Share Posted July 8, 2008 A variable (or field) will never equal itself minus a number. You have to have a different rank variable that you are comparing it to. Something like: "... WHERE rank = ".$rank-3; And I don't think that you can make multiple updates in one query. Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted July 8, 2008 Share Posted July 8, 2008 UPDATE accepts a coma separated list of columns to update (like it shows in the mysql manual). You have an "and" with is a logical operator. UPDATE `members` SET `disabled` = '0', `rank` = `rank`-3 WHERE username = 'test' Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.