Switch0r Posted December 8, 2007 Share Posted December 8, 2007 Im trying to retrieve a set of records by their starting character, some of which begin with numbers. I have no problem getting the lettered items out, just the numbers. What i want to have is a list that gives everything starting 0-9, then letters from a-z. Firstly is there any query that will search for an array of LIKE values? id. LIKE '0-9%'? Or am I going to have to run a while loop on the query for each number separately? (Which I also have no problem doing, it just seems rather an inelegant way of doing things... Thanks for any help Link to comment https://forums.phpfreaks.com/topic/80821-solved-help-with-like/ Share on other sites More sharing options...
Switch0r Posted December 8, 2007 Author Share Posted December 8, 2007 right, I figured it out...I feel sheepish I was trying to use LIKE multiple times which wasnt working, as i wasnt telling it what it should be like each time. ie where title like '1%' or '2%' etc... - wrong! where title like '1%' or title like '2%' etc... - works like a charm Link to comment https://forums.phpfreaks.com/topic/80821-solved-help-with-like/#findComment-410002 Share on other sites More sharing options...
fenway Posted December 9, 2007 Share Posted December 9, 2007 The "range" is a REGEXP. Link to comment https://forums.phpfreaks.com/topic/80821-solved-help-with-like/#findComment-410371 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.