📅  最后修改于: 2022-03-11 15:03:27.733000             🧑  作者: Mango
// Function to insert multiple Row in database
let multipleRowInsert = () => {
// Query to insert multiple rows
let query = `INSERT INTO gfg_table
(name, address) VALUES ?;`;
// Values to be inserted
let values = [
['Amit', 'Yellow Park'],
['Rishi', 'Park 38'],
['Akash', 'Central st 954'],
['Pratik', 'Road 989'],
['Mangesh', 'Sideway']
];
// Executing the query
db_con.query(query, [values], (err, rows) => {
if (err) throw err;
console.log("All Rows Inserted");
});
};