Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: MySQL Like Statement and case sensitivity

by gryphon (Abbot)
on Sep 06, 2002 at 23:46 UTC ( [id://195804]=note: print w/replies, xml ) Need Help??


in reply to MySQL Like Statement and case sensitivity

Greetings andrew,

I think what you're wanting is to use LIKE's wild-card character.

$sth = $dbh->prepare(q{ SELECT * FROM items WHERE description LIKE ? OR longdescription LIKE ? }); $sth->execute('%' . $search . '%', '%' . $search . '%') or die $dbh->e +rrstr;

Notes: Placeholders are your friend. (a.k.a. bind values) Always use them.

gryphon
code('Perl') || die;

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (3)
As of 2024-04-20 01:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found