I need to make a MySQL query using "WHERE IN". This is my request:
var myQuery = 'SELECT uid FROM ' +tableName+ ' where Gender IN (' + Info.Gender.join() + ')';
If I type Info.Gender , it will be ['Male', 'Female'], like a string. but when the request is executed, it says
SELECT uid FROM appUsers where Gender IN (Male, Female)
But it should be:
SELECT uid FROM appUsers where Gender IN ('Male', 'Female')
This means that it takes the value βWomanβ not as a string.
Any ideas?
source share