title: How to avoid Sql Injection for PHP Yii2 framework inside the andFilterWhere function
body: <p>I am new to PHP and Yii2 framework, I believe there should be some way similar to their official doc but I could not find out. Please see the code.</p>
  <pre><code>$query = new Query(). 
  $query-&gt;andFilterWhere(
                          [
                              'like',
                              LiveListData::tableName() . '.originalRoamerRequestId',
                              $pattern
                          ]
                      );
  </code></pre>
  <p>I want to escape the $pattern variable because that is an user input. Could any please tell me how should I do that please? Their official doc provides an example, but I cannot get any clue from there.</p>
  <p>Below is their docs</p>
  <pre><code>$userIDs = (new Query())
  -&gt;select('id')
  -&gt;from('user')
  -&gt;where('status=:status', [':status' =&gt; $status])
  -&gt;all();
  </code></pre>
  <p>Your help will be much appreciated</p>