Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

589
Views
Nodejs MySQL ER_PARSE_ERROR on Insert Query errorno: 1064
app.post('', (req, res) => {
    pool.getConnection((err, connection) => {
        if (err) throw err
        console.log('connected as id' + connection.threadID)
        const params = req.body;

        connection.query('INSERT INTO beers SET ?', [params], (err, rows) => {
            connection.release()

            if (!err) {
                res.send('Successfully added record of name' + params.name)
            } else {
                console.log(err)
            }
        })

        console.log(req.body)
    })
})
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

I'm not sure what kind of library you're using to communicate with the DB, but I reckon, it should look more like

 connection.query('INSERT INTO beers(someColumn, someOtherColumn) VALUES (?,?)', [params.valueOfSomeColumn, params.valueOfSomeOtherColumn],...blabla the rest)
  1. Looks like you're mixing up the INSERT and UPDATE statements. INSERT doesn't use SET
  2. Usually this sort of basic DB libs connect the ? characters with the value from an array
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!