title: Doctrine2 using setParameters
body: <p>when I seem to use parameters in my query, I get an error</p>
  
  <blockquote>
    <p>Invalid parameter number: number of bound variables does not match number of tokens</p>
  </blockquote>
  
  <p>here is my code</p>
  
  <pre class="lang-php prettyprint-override"><code>public function GetGeneralRatingWithUserRights($user, $thread_array)
  {
      $parameters = array(
          'thread' =&gt; $thread_array['thread'],
          'type' =&gt; '%'.$thread_array['type'].'%'
      );
  
      $dql = 'SELECT p.type,AVG(p.value) 
          FROM TrackerMembersBundle:Rating p 
          GROUP BY p.thread,p.type';
  
      $query = $this-&gt;em-&gt;createQuery($dql)
          -&gt;setParameters($parameters);
  
      $ratings = $query-&gt;execute();
  
      return $ratings;
  }
  </code></pre>
  
  <p>How do I configure the parameters array properly?</p>