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 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;} ? 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... 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 =. Link to comment https://forums.phpfreaks.com/topic/215704-mysql-if-statement/#findComment-1122974 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.