I am trying to pull data from a table in MYSQL and save it to another table. Here is my code: The two tables have the exact same columns. NOTE: The row does get saved but every value is apparently zero. Whenever I save this, MYSQL makes a new row with an index but all values are zero.
client.query('SELECT * FROM archive ORDER BY stamp LIMIT 1', function(err, result){
var nor = result[0].Northatt;
var eas = result[0].Eastatt;
var sou = result[0].Southatt;
var wes = result[0]. Westatt;
var time = result[0].stamp;
client.query("INSERT INTO quartly (Northatt, Eastatt, Southatt, Westatt, stamp) VALUES ('+nor+','+eas+','+sou+','+wes+','+time+')", function()err{
});
});
All of the variables are holding their respective 'int'...pretty sure I'm using the right syntax to save variables too.
Any help would be appreciated!