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. Quote Link to comment 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%")) " Quote Link to comment 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 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.