l0ve2hat3 Posted January 26, 2010 Share Posted January 26, 2010 I would like to know if it is possible to do a condition inside of the where part of a select query. ex. SELECT * FROM `table` WHERE `field2`="3" CASE `field1` WHEN "1" AND `field3`="3" END AND `field4`="4" Quote Link to comment https://forums.phpfreaks.com/topic/189879-condition-inside-query-where/ Share on other sites More sharing options...
l0ve2hat3 Posted January 26, 2010 Author Share Posted January 26, 2010 anyone? Quote Link to comment https://forums.phpfreaks.com/topic/189879-condition-inside-query-where/#findComment-1002025 Share on other sites More sharing options...
fenway Posted January 28, 2010 Share Posted January 28, 2010 Use an IF() in the where clause instead. Quote Link to comment https://forums.phpfreaks.com/topic/189879-condition-inside-query-where/#findComment-1002791 Share on other sites More sharing options...
l0ve2hat3 Posted February 1, 2010 Author Share Posted February 1, 2010 could you show me an example with the IF clause? Quote Link to comment https://forums.phpfreaks.com/topic/189879-condition-inside-query-where/#findComment-1005163 Share on other sites More sharing options...
fenway Posted February 11, 2010 Share Posted February 11, 2010 could you show me an example with the IF clause? What conditions are you trying to check? Quote Link to comment https://forums.phpfreaks.com/topic/189879-condition-inside-query-where/#findComment-1010506 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.