|
Posted by Stefan Rybacki on 08/24/05 20:09
muldoonaz wrote:
> For those of you who braved looking at this thread, i commend thee.
> out of all the PHP and MySQL work I've done, REGEXP is purely chinese
> to me. Thus I seek all of you out there with knowledge about REGEXP
> that is far greater than mine.
>
> I have a database with comma separated values (ie. 2,3,4,5 [note, no
> leading or trailing commas]) that cross-reference to another table's
> ID's. I need a way to send a SQL query to the db to search within the
> comma separated values and find whichever entries match the search.
>
> Mind you, LIKE doesn't work (at least I haven't been able to get it to
> work). For instance, LIKE %4% will pull up entries with 4, but also
> with 44, 444, 4444, 14, 24, you get the idea. Thus REGEXP seems the
> way to go.
Nope, the way to go is to repair you database design. Are you able to change it?
Stefan
> If anyone out there can help me by providing me information on building
> a REGEXP string to do what I need it to, I would be forever grateful!
>
[Back to original message]
|