Skip to content

Instantly share code, notes, and snippets.

@ctavan
Created July 26, 2011 11:38
Show Gist options
  • Save ctavan/1106547 to your computer and use it in GitHub Desktop.
Save ctavan/1106547 to your computer and use it in GitHub Desktop.
Pass arrays to node-mysql's client.format()
var ids = [291, 9123, 218];
client.query(
'SELECT * FROM campaigns WHERE campaign_id IN (?)',
[ ids ],
function selectCb(err, results, fields) {
if (err) {
console.log(err);
throw err;
}
console.log(results);
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment