dzhax Posted August 25, 2011 Share Posted August 25, 2011 I am editing a query that I have been using and not sure how to do thisI need to use both AND & OR Statements in the same query.I already have: (Please mind the format... this is being put into a php script) 'SELECT * FROM rank_fight_list WHERE fighterID1='.$this->fighterID.' OR fighterID2='.$this->fighterID; I need to add that the STATUS field must also be 'Official' or 'NSF'Not sure if I need to break the two or statements up with parentheses along with an AND in between or not.Any help would be appreciated. I would experiment but i hate butchering what already works fine. Link to comment Share on other sites More sharing options...
JamesB Posted September 1, 2011 Share Posted September 1, 2011 this should work: 'SELECT * FROM rank_fight_list WHERE (STATUS=\'Official\' OR STATUS=\'NSF\') AND (fighterID1='.$this->fighterID.' OR fighterID2='.$this->fighterID.')'; Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.