chrisuk Posted March 11, 2007 Share Posted March 11, 2007 I am trying to select data from a database that does not match two values eg: "SELECT * FROM table WHERE reason != 'reason1' OR 'reason2'"; so if there were 5 reasons, it would show all data matching reason3, reason4 and reason5 however....when i have done this its only using the first one because its including the other in the results count. What am i doing wrong? Link to comment https://forums.phpfreaks.com/topic/42220-solved-using-or-in-sql-queries/ Share on other sites More sharing options...
trq Posted March 11, 2007 Share Posted March 11, 2007 SELECT * FROM table WHERE reason != 'reason1' OR reason != 'reason2'; Link to comment https://forums.phpfreaks.com/topic/42220-solved-using-or-in-sql-queries/#findComment-204788 Share on other sites More sharing options...
chrisuk Posted March 11, 2007 Author Share Posted March 11, 2007 Thanks! I tried that and it did the same but then i changed OR to AND and now it works! Link to comment https://forums.phpfreaks.com/topic/42220-solved-using-or-in-sql-queries/#findComment-204813 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.