Eggzorcist Posted June 24, 2012 Share Posted June 24, 2012 Hi there, I was wondering if there is a method or logical operator to have a combination of && and or operators. so I want to be either friend1 = $user && or friend2 = $user. How is this done in SQL? Checked the mysql manual but not sure if it's that straight forward. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/264710-mysql-logic-operator-for-combination-of-and-or/ Share on other sites More sharing options...
Pikachu2000 Posted June 25, 2012 Share Posted June 25, 2012 That makes no sense from a logical standpoint. What exactly is it you're trying to accomplish? Quote Link to comment https://forums.phpfreaks.com/topic/264710-mysql-logic-operator-for-combination-of-and-or/#findComment-1356706 Share on other sites More sharing options...
Eggzorcist Posted June 25, 2012 Author Share Posted June 25, 2012 Oh yea, sorry. Been a long day. I think I've accomplished my goal with an or statement. I just wanted an or but also the data set might satisfy both requirement and would like to have both rows. Is that done with or? Quote Link to comment https://forums.phpfreaks.com/topic/264710-mysql-logic-operator-for-combination-of-and-or/#findComment-1356707 Share on other sites More sharing options...
Pikachu2000 Posted June 25, 2012 Share Posted June 25, 2012 Yes, OR is what you need in that case. Quote Link to comment https://forums.phpfreaks.com/topic/264710-mysql-logic-operator-for-combination-of-and-or/#findComment-1356708 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.