public function search($search)
{
global $pdo;
$query = $pdo->prepare('SELECT * FROM items WHERE item_name = ?');
$query->bindValue(1, $search);
$query->execute();
return $query->fetchAll();
}
with that function if I called it, and say $search
was cookie
.
and inside my database I have
chocolate chip cookie
oatmeal cookie
cookie
it would only return cookie
So how could I fix my query so it returns all the item_name
s that are a partial match or contain cookie also? Thanks.