$str = $dbh->quote("%it's not a problem%"); $sth = $dbh->prepare( "SELECT * FROM practice WHERE name LIKE $str" ) || die "Error: " . $dbh->errstr; $sth->execute() || die "Error: " . $sth->errstr; OR BETTER $str = "%it's not a problem%"; $sth = $dbh->prepare( "SELECT * FROM practice WHERE name LIKE ?" ) || die "Error: " . $dbh->errstr; $sth->execute($str) || die "Error: " . $sth->errstr;