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

238
Views
¿Cómo insertar mi fila en MYSQL en bucle con javascript?

Estoy llamando a una función que inserta una fila en MySQL. esto está dentro de un bucle, pero me da el error. Error: no se puede poner en cola el protocolo de enlace después de haber puesto en cola un protocolo de enlace.

 var mysql = require('mysql'); var con = mysql.createConnection({ host: "fleet.iad1-mysql-e2-20a.dreamhost.com", user: "seesi", password: "saml3651", database: "bazaar_data" }); function run(){ con.connect(function(err) { if (err) throw err; console.log("Connected!"); //Insert a record in the "customers" table: var sql = "INSERT INTO Bazaar_Orders_Price (name, address, city, state) VALUES ('jeff', 'your face', 'Chicago', 'IL')"; con.query(sql, function (err, result) { if (err) throw err; console.log("1 record inserted"); }); }); } for(i=0; i<5; i++) { run() }
about 4 years ago · Juan Pablo Isaza
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!