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
Raw Normal View History

2021-03-12 12:34:06 +00:00
const con = require('./connect')
function insertDB(barcode, shelving, level){
con.con.connect(function(err) {
if (err) throw err;
console.log("Connected!");
2021-03-12 12:54:21 +00:00
var sql = `INSERT INTO vn.smartTag (code, shelvingFk, level) VALUES ('${barcode}', '${shelving}', ${level})`;
2021-03-12 12:34:06 +00:00
con.con.query(sql, function (err, result) {
if (err) throw err;
console.log("1 record inserted");
});
});
2021-03-12 12:54:21 +00:00
}
exports.insertDB = insertDB;