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 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 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
Archived
This topic is now archived and is closed to further replies.