bayder Posted October 27, 2003 Share Posted October 27, 2003 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 More sharing options...
Barand Posted October 27, 2003 Share Posted October 27, 2003 Do ()\'s help? eg SELECT DISTINCT mystuff FROM table WHERE ((mystuff NOT LIKE "%one%") OR (mystuff NOT LIKE "%two%")) " Link to comment https://forums.phpfreaks.com/topic/1227-is-multiple-not-like-possible/#findComment-4113 Share on other sites More sharing options...
bayder Posted October 27, 2003 Author Share Posted October 27, 2003 Yes SELECT DISTINCT mystuff FROM table WHERE mystuff NOT LIKE (\"%one%\") OR mystuff NOT LIKE (\"%two%\")\" Thank you Link to comment https://forums.phpfreaks.com/topic/1227-is-multiple-not-like-possible/#findComment-4114 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.