is it possible to create a pdo query with a variable? Example:
$q = "SELECT COUNT (*) c FROM blogpages WHERE keywords LIKE '%test%' ";
then
$query = $db->query("$q");
$result = $query->fetch(PDO::FETCH_ASSOC);
when i do this i get an error
"Call to a member function fetch() on a non-object in C....."
i want to know is there a way to place the query in there as a variable because the query changes depending on how many OR statements are in the query