newbeee Posted December 23, 2008 Share Posted December 23, 2008 what is the correct way to use AND & OR in query SELECT `username`, `md5` FROM `users` WHERE (`md5` == 'confirmed' OR `md5` == 'SUSPENDED') AND `username` = '".$username."' LIMIT 1 Quote Link to comment https://forums.phpfreaks.com/topic/138162-what-is-the-correct-way-to-use-and-or-in-query/ Share on other sites More sharing options...
ngreenwood6 Posted December 23, 2008 Share Posted December 23, 2008 I think that it should be like this: SELECT `username`, `md5` FROM `users` WHERE `md5` = 'confirmed' OR `md5` = 'SUSPENDED' AND `username` = '".$username."' LIMIT 1 Please let us know if you get any errors Quote Link to comment https://forums.phpfreaks.com/topic/138162-what-is-the-correct-way-to-use-and-or-in-query/#findComment-722309 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.