Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

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

Comment on Re: MySQL Like Statement and case sensitivity
Download Code

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2015-10-07 01:10 GMT
Find Nodes?
    Voting Booth?

    Does Humor Belong in Programming?

    Results (169 votes), past polls