db update

This commit is contained in:
llopis15 2021-03-12 11:34:54 +01:00
parent ac7847c3cc
commit 033e4a6e12
3 changed files with 8 additions and 3 deletions

View File

@ -1,5 +1,5 @@
const mysql = require('mysql');
const config = require('./config');
const config = require('../config');
var con = mysql.createConnection({
host: "test-db.verdnatura.es",
@ -9,4 +9,9 @@ var con = mysql.createConnection({
port: 3307,
});
con.connect(function(err) {
if (err) throw err;
console.log("Connected!");
});
exports.con = con;

View File

View File

@ -1,9 +1,9 @@
const con = require('./connectDB.js')
const con = require('./connect.js')
con.con.connect(function(err) {
if (err) throw err;
console.log("Connected!");
var sql = "INSERT INTO vn.smartTag (code, shelvingFk, `level`) VALUES('A0A3B8200DA9', 'ABC', 2);";
var sql = "INSERT INTO vn.smartTag (code, shelvingFk, `level`) VALUES('A0A3B8200DA1', 'ABC', 2);";
con.con.query(sql, function (err, result) {
if (err) throw err;
console.log("1 record inserted");