title: Use an array in a mysqli prepared statement: `WHERE .. IN(..)` query
body: <p>Imagine we have a query:</p>
  <pre><code>SELECT * FROM somewhere WHERE `id` IN(1,5,18,25) ORDER BY `name`;
  </code></pre>
  <p>and an array of IDs to fetch: <code>$ids = array(1,5,18,25)</code></p>
  <p>With prepared statements it's <a href="https://stackoverflow.com/questions/330268/i-have-an-array-of-integers-how-do-i-use-each-one-in-a-mysql-query-in-php/330280#330280">adviced</a> to prepare one statement and call it multiple times:</p>
  <pre><code>$stmt = $mysqli-&gt;prepare('SELECT * FROM somewhere WHERE `id`=?;');
  foreach ($ids as $id){
      $stmt-&gt;bind_params('i', $id);
      $stmt-&gt;exec();
  }
  </code></pre>
  <p>But now I'll have to sort the results manually. Do I have any nice alternatives?</p>