Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

310
Vistas
how to insert this object to mysql db in nodejs using mysql-crud

I am new to nodejs and mysql. I want to insert some data to mysql database using nodejs. I've tried to do it with and without mysql-crud modules but I failed. Can anyone help me?

exports.insertquotereq = function(req, res){

        var chat_data = {
            to_country: req.whereto,
            to_airport: req.toairport,
            from_country: req.fromwhere,
            from_airport: req.fromairport,
            planetype: req.planetype,
            startdate: req.startdate,
            starttime: req.starttime,
            returndate: req.returndate,
            returntime: req.returndate,
            email: req.email,
            distance: req.distance,
            estimatedhrs: req.estimatedhrs,
            planecostperhr: req.planecostperhr,
            estimatedcost: req.estimatedcost,
            estimated_time: req.estimated_time
        };
        //console.log('chat_data',chat_data);
        var insert = connection.query("INSERT INTO chat SET ?", chat_data, function(err, result){
            if(err) throw err;
            console.log('data inserted'+insert);
        });

};
over 4 years ago · Santiago Trujillo
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda