This repository has been archived on 2024-10-02. You can view files and clone it, but cannot push or open issues or pull requests.
smart-tag/db/insertDB.js

14 lines
438 B
JavaScript

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");
});
});
}
exports.insertDB = insertDB;