Jump to content

Is multiple "not like" possible?


bayder

Recommended Posts

Hi,

 

I am trying to create a query to filter out using \"not like\" now this is fine if I use a single \"not like\", but I always get an error when using a second or more.

 

for example

 

mysql_query(\"SELECT DISTINCT mystuff FROM table WHERE mystuff NOT LIKE \"%one%\" OR mystuff NOT LIKE \"%two%\"\");

 

which is strange because the \"like\" syntax works fine

 

eg.

mysql_query(\"SELECT DISTINCT mystuff FROM table WHERE mystuff LIKE \"%one%\" OR mystuff LIKE \"%two%\"\");

 

Can anyone enlighten me here please.

Link to comment
https://forums.phpfreaks.com/topic/1227-is-multiple-not-like-possible/
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.