title: node-mysql escaping query values - array with unknown length
body: <p>I use node.js and the module node-mysql for connecting to the mySQL server. However, I got some problems when I tried to escape an array in a query. Here is my code:</p>
  
  <pre><code>connection.query("select * from table where id in (?)", [1, 3, 5], function(err, res) {
      ...
  });
  </code></pre>
  
  <p>The above query is <code>select * from table where id in (1)</code>, which is not my expectation.</p>
  
  <p>As the documents said:</p>
  
  <p><code>Arrays are turned into list, e.g. ['a', 'b'] turns into 'a', 'b'</code></p>
  
  <p>I know <code>select * from table where id in (?,?,?)</code> works. The question is, what should I do if I have an array with unknown length?</p>