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' Quote 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 Quote Link to comment https://forums.phpfreaks.com/topic/183381-if-satements-in-selectclause/#findComment-967979 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.