exports.addProduct = catchAsyncErrors( async (req,res,next) =>{ pool.getConnection((err, connection) => { console.log('1') if(err) throw err console.log('2') const params = req.body connection.query('INSERT INTO product SET ?', params, (err, rows) => { console.log('3') connection.release() // return the connection to pool if (!err) { res.send(`product with the record ID has been added.`) } else { console.log(err) } console.log('The data from product table are:11 \n', rows) }) }) })
i don't why this error is occurring even i check manually couple of time but i didn't resolve it
Quote: SQL INSERT INTO product SET ?
INSERT INTO product SET ?
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)