in reply to SQL pulling information

Would I be able to use like a rex in my SQL statement like
$sth = $dbh->prepare("SELECT * FROM items WHERE m_category =~ /\|?44\| +?/");
Would that ever be possible or do that have a function I heard of REGEXP but dont understand.

Replies are listed 'Best First'.
Re: Re: SQL pulling information
by reyjrar (Hermit) on Oct 16, 2002 at 22:13 UTC
    Try searching around mysql.com's documentation a little bit. I knew how to do this but I wanted to find the documentation. You know what they say, give a man a fish, he eats for a day, teach a man to fish, he can eat for life. In that spirit I scrounged up a link for you.

    All the examples look like:
    SELECT "string" REGEXP "some regex";
    all this does is return 1 or 0. in your situation, your select will look something like this:
    SELECT col1, col2, ... FROM table WHERE col1 REGEXP 'your regex'


    I hope this helps.

    -brad..