Jump to content

[SOLVED] using OR in SQL queries?


chrisuk

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.