This commit is contained in:
llopis15 2021-03-12 13:34:06 +01:00
parent ea59af68db
commit d83d73ce49
1 changed files with 13 additions and 0 deletions

13
db/insertDB.js Normal file
View File

@ -0,0 +1,13 @@
const con = require('./connect')
function insertDB(barcode, shelving, level){
con.con.connect(function(err) {
if (err) throw err;
console.log("Connected!");
var sql = `INSERT INTO vn.smartTag (code, shelvingFk, level) VALUES (${barcode}, ${shelving}, ${level})`;
con.con.query(sql, function (err, result) {
if (err) throw err;
console.log("1 record inserted");
});
});
}