Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: MySQL Like Statement and case sensitivity

by greywolf (Priest)
on Sep 07, 2002 at 02:31 UTC ( [id://195825]=note: print w/replies, xml ) Need Help??


in reply to MySQL Like Statement and case sensitivity

Here is another way to use placeholders. This can be more readable when you have lots of them. I would like to second the motion that 'SELECT *' is a bad thing. Always specify what you want to retrieve.
$query = "SELECT * FROM items WHERE description LIKE ? OR longdescri +ption LIKE ?"; $sth = $dbh->prepare($query); $sth->bind_param(1, $search); $sth->bind_param(2, $search); unless ($sth->execute()) { die $dbh->errstr() }
mr greywolf

Log In?
Username:
Password:

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

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

    No recent polls found