I am inserting dynamic records
var sql = "INSERT INTO Test (name, email, n) VALUES ?";
var values = [
['test', '[email protected]', 1],
['test', '[email protected]', 2],
['mark', '[email protected]', 3],
['pete', '[email protected]', 4]
];
conn.query(sql, [values], function(err) {
if (err) throw err;
conn.end();
});
here is example which is working fine
Now my data is here
var arr = category_ids.split(",");
for (var i = 0; i < arr.length; i++) {
}
How to make dynamic array of values in for loop
Thanks