barkster Posted July 2, 2006 Share Posted July 2, 2006 I'm trying to do a query where a field does not contain an underscore in the value but will now work? How can I make this work? ThanksSELECT Category,SortingFROM CategoryWHERE Category.Sorting Not Like '%_%'ORDER BY Category ASC Quote Link to comment https://forums.phpfreaks.com/topic/13483-query-with-underscore/ Share on other sites More sharing options...
barkster Posted July 2, 2006 Author Share Posted July 2, 2006 Found it had to add \SELECT Category,SortingFROM CategoryWHERE Category.Sorting Not Like '%\_%'ORDER BY Category ASC Quote Link to comment https://forums.phpfreaks.com/topic/13483-query-with-underscore/#findComment-52153 Share on other sites More sharing options...
fenway Posted July 3, 2006 Share Posted July 3, 2006 Yeah, underscores are wildcard characters too, and thus need to be escaped if you want a literal underscore. Quote Link to comment https://forums.phpfreaks.com/topic/13483-query-with-underscore/#findComment-52331 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.