topflight Posted July 21, 2010 Share Posted July 21, 2010 I am trying to write a mysql query that will get either information take a look $opm2 = mysql_query("SELECT * FROM `o` WHERE id='$id' AND a='AL OR a=EG'"); When I run that query it gets the wrong information, it dosen't even get the ID, it get some random ID. The main question is how do you write an OR statement in a mysql_query Link to comment https://forums.phpfreaks.com/topic/208359-or-statement-in-mysql_query/ Share on other sites More sharing options...
johnsmith153 Posted July 21, 2010 Share Posted July 21, 2010 SELECT * FROM `o` WHERE id='$id' AND (a='AL' OR a='EG') Link to comment https://forums.phpfreaks.com/topic/208359-or-statement-in-mysql_query/#findComment-1088874 Share on other sites More sharing options...
topflight Posted July 21, 2010 Author Share Posted July 21, 2010 thanks Link to comment https://forums.phpfreaks.com/topic/208359-or-statement-in-mysql_query/#findComment-1088875 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.