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 Quote Link to comment 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') Quote Link to comment Share on other sites More sharing options...
topflight Posted July 21, 2010 Author Share Posted July 21, 2010 thanks Quote Link to comment 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.