flemingmike Posted October 5, 2010 Share Posted October 5, 2010 hello, so when i use like 'a%' it gives me all names stating with a when i use not like 'a%', it gives me all names that dont start with a how would i use not like so it would show me all names that dont start with a, b or c? Link to comment https://forums.phpfreaks.com/topic/215232-using-not-like/ Share on other sites More sharing options...
MatthewJ Posted October 5, 2010 Share Posted October 5, 2010 WHERE field NOT LIKE 'a%' OR field NOT LIKE 'b%' OR field NOT LIKE 'c%' Link to comment https://forums.phpfreaks.com/topic/215232-using-not-like/#findComment-1119383 Share on other sites More sharing options...
Psycho Posted October 5, 2010 Share Posted October 5, 2010 WHERE field NOT LIKE 'a%' OR field NOT LIKE 'b%' OR field NOT LIKE 'c%' Not quite! That query would match ALL records in the table because it is using OR. Change the OR's to AND's to get the results you are looking for. Link to comment https://forums.phpfreaks.com/topic/215232-using-not-like/#findComment-1119384 Share on other sites More sharing options...
flemingmike Posted October 5, 2010 Author Share Posted October 5, 2010 perfect. thanks Link to comment https://forums.phpfreaks.com/topic/215232-using-not-like/#findComment-1119392 Share on other sites More sharing options...
MatthewJ Posted October 5, 2010 Share Posted October 5, 2010 Doh! You know what I meant Link to comment https://forums.phpfreaks.com/topic/215232-using-not-like/#findComment-1119402 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.