Destramic Posted October 12, 2010 Share Posted October 12, 2010 hey guys i have an if statement and if it returns false then i want it to change to variable values....something like this but it doesn't work IF(@points = '0', @rank + 1, @rank @drawing = '1') can anyone tell me how this is possible please Quote Link to comment https://forums.phpfreaks.com/topic/215704-mysql-if-statement/ Share on other sites More sharing options...
yuso6363 Posted October 12, 2010 Share Posted October 12, 2010 i'm not quite sure what you mean but shouldnt it be: if($points == 1) {$rank ++; $drawing = 1;} ? Quote Link to comment https://forums.phpfreaks.com/topic/215704-mysql-if-statement/#findComment-1121504 Share on other sites More sharing options...
chintansshah Posted October 12, 2010 Share Posted October 12, 2010 I don't understand, it's quite confusing for me... Quote Link to comment https://forums.phpfreaks.com/topic/215704-mysql-if-statement/#findComment-1121509 Share on other sites More sharing options...
fenway Posted October 17, 2010 Share Posted October 17, 2010 hey guys i have an if statement and if it returns false then i want it to change to variable values....something like this but it doesn't work IF(@points = '0', @rank + 1, @rank @drawing = '1') can anyone tell me how this is possible please If you're talking about mysql user variables, you need to assign with :=, not =. Quote Link to comment https://forums.phpfreaks.com/topic/215704-mysql-if-statement/#findComment-1122974 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.