title: WHERE IN ($array) AND something =?
body: <p>I have this, where <code>$results_array</code> is an array of imploded integers:</p>
  
  <pre><code>if ($stmt = $cxn-&gt;prepare('SELECT id FROM follows WHERE id IN (' . $results_array . ') AND user_id = ?')) {
      $stmt-&gt;bind_param('i', $user_id);
      $stmt-&gt;execute();
      $stmt-&gt;store_result();
      $stmt-&gt;bind_result($temp);
  
      $final_array = array();
      while($stmt-&gt;fetch()) {
          $final_array[] = $temp;
      }
  
      $final_array = implode(',', $final_array);
  
      $stmt-&gt;close();
  }
  </code></pre>
  
  <p>The problem lies in the query's <code>AND</code> check. If I remove the <code>AND</code> check, it works fine, but I need to have that check there. How do I fix this?</p>