Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: MySQL Like Statement and case sensitivity

by greywolf (Priest)
on Sep 07, 2002 at 02:31 UTC ( #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
Node Status?
node history
Node Type: note [id://195825]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2018-02-20 08:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    When it is dark outside I am happiest to see ...














    Results (268 votes). Check out past polls.

    Notices?