I have a look-up table:
CREATE TABLE technologies (
technologyName VARCHAR(50) NOT NULL PRIMARY KEY
);
I want to store a new record in this table for every element in an array:
var values = ['Grunt', 'Gulp'];
So that the resulting table will look like:
+----------------+
| technologyName |
+----------------+
| Grunt |
+----------------+
| Gulp |
+----------------+
How can I do this using Node?
Update:
I know I can do something like this:
var values = [
[
['Grunt'],
['Something']
]
]
connection.query('INSERT IGNORE INTO technologies (technologyName) VALUES ?', values);
I tried this with the original array but it does not work. How can I convert the simple array into the more complicated one?