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