Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: SQL pulling information

by andrew (Acolyte)
on Oct 16, 2002 at 21:59 UTC ( [id://205861]=note: print w/replies, xml ) Need Help??


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..

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://205861]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (3)
As of 2024-04-25 09:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found