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 Link to comment https://forums.phpfreaks.com/topic/113823-mysql-set/ 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. Link to comment https://forums.phpfreaks.com/topic/113823-mysql-set/#findComment-584903 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' Link to comment https://forums.phpfreaks.com/topic/113823-mysql-set/#findComment-584917 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.