Jump to content

[SOLVED] Help with LIKE...


Switch0r

Recommended Posts

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.