Answer the question
In order to leave comments, you need to log in
Asynchrony, promises, exports, database query. How?
Good day. There is a model for receiving data, of the form:
var data = {};
data.one = function(){};
data.two = ...
module.exports = data;
connection.query('SELECT balance FROM Users WHERE id = ?', id, function(error, result, fields){
if(error)
throw(error);
return result;
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question