title: Yii2 SQLSTATE[HY093]: Invalid parameter number: no parameters were bound
body: <p>In my ModelSearch I have the code like this:
  </p>
  
  <pre><code>$candidates = Candidate::find();
  $dataProvider = new ActiveDataProvider([
     'query' =&gt; $candidates
  ]);
  </code></pre>
  
  <p>and then I'm trying to proceed this query:
  </p>
  
  <pre><code>$candidates-&gt;andFilterWhere([
     ' or ',
     ['like', 'candidate.something', $this-&gt;word],
     ['like', 'candidate.anything', $this-&gt;word]
  ]);
  </code></pre>
  
  <p>and at the end i return <code>$dataProvider</code>.</p>
  
  <p>I remember that i used that kind of piece of code many times and never had any problems with it, but unexpectedly after the whole trying I still receive the same error:
  </p>
  
  <pre><code>SQLSTATE[HY093]: Invalid parameter number: no parameters were bound
  The SQL being executed was: SELECT COUNT(*) FROM (SELECT * FROM `candidate` WHERE Array OR 'like' GROUP BY `candidate`.`id`) `c`
  </code></pre>
  
  <p>When I write the piece of code in that way:
  </p>
  
  <pre><code>$candidates-&gt;andFilterWhere([
     ' or ',
     'candidate.`something` LIKE "%' . $this-&gt;word . '%" ',
     'candidate.`anything` LIKE "%' . $this-&gt;word . '%"',
  ]);
  </code></pre>
  
  <p>It seems to work, but i don't want to do it like that. I suppose that the clue of the problem can be somewhere else, but I have no idea where else i should look for it.</p>
  
  <p>Any sugestions?</p>
  
  <p>Best regards.</p>
  
  <p><strong>[EDIT] SOLVED:</strong></p>
  
  <p><a href="https://stackoverflow.com/users/4323648/arogachev">@arogachev</a>'s prompt turned out to be right way: <strong>just delete spaces from</strong> "<code>or</code>" <strong>made it work.</strong>
  QueryInterface doesn't recognize condition operator which is not trimmed, thats the reason it got fooled (and me by the way).</p>