I have a Subscribers table which consists of emails (not unique) and a category for each email. I am trying to find the emails for each category using the following function but get the error:
Invalid parameter number: number of bound variables does not match number of tokens
This is my function:
public function findEmailsByCategory($category)
{
$result = $this->getEntityManager()
->createQuery(
'SELECT s.email FROM NEWSBlogBundle:Subscribers s WHERE s.category =:category'
)->getResult();
return $result;
}
Can anyone tell me where I'm going wrong?