So I am currently trying to make a query in Node.js:
// friends is an array object
db.all('SELECT email ' +
'FROM users' +
'WHERE email in ?', friends, function(err, rows) {
if (!err) {
I know that you can pass in an array of parameters for every '?' symbol, but is it possible to use the IN operator in this case? If not, should I do string concatenation or prepared statements?
db.all('SELECT email ' +
'FROM users' +
'WHERE email in ( ' + friends.map(function(){ return '?' }).join(',') + ' )',
friends,
function(err, rows) {
if (!err) {
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With