I have the following code that is not returning any results. When I change :search_term
to just $search_term
it will return one result as expected but when I use a wildcard it just returns 0.
$query = $db->getConnection()->prepare("SELECT * FROM `coils` WHERE coil_name IS LIKE '%:search_term%' ORDER BY id DESC LIMIT {$start}, {$perPage}");
$query->execute(array(
':search_term' => $search_term
));
echo $query->rowCount()
I have a feeling that I'm just not using it correctly. Any help would be great. Thanks!