EchoFool Posted November 30, 2009 Share Posted November 30, 2009 Hey, Is it possible in WHERE clauses to use IF statements on PHP variables to MYSQL fields? Example : SELECT If($Var == 'no'){ User }ElseIf($Var == 'yes'){ Admin } FROM user_table WHERE UserID='$UserID' Link to comment https://forums.phpfreaks.com/topic/183381-if-satements-in-selectclause/ Share on other sites More sharing options...
abazoskib Posted November 30, 2009 Share Posted November 30, 2009 http://dev.mysql.com/doc/refman/5.0/en/control-flow-functions.html#function_if Link to comment https://forums.phpfreaks.com/topic/183381-if-satements-in-selectclause/#findComment-967979 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.