I am running problems in implementing LIKE in PDO
I have this query:
$query = "SELECT * FROM tbl WHERE address LIKE '%?%' OR address LIKE '%?%'";
$params = array($var1, $var2);
$stmt = $handle->prepare($query);
$stmt->execute($params);
I checked the $var1
and $var2
they contain both the words I want to search, my PDO is working fine since some of my queries SELECT
INSERT
they work, it's just that I am not familiar in LIKE
here in PDO.
The result is none returned. Do my $query
is syntactically correct?