Hi,
I have a mysql query like this:
con.query("SELECT name FROM members WHERE id=1", function(err, rows, fields) {
console.log(rows);
});
the problem with this is that it forces me to put pretty much ALL my code inside this function in order to get the value from rows where I want it. Isnt there any other way more simple? Like store the value into a variable so I can use it later as many times as I need it? Like this:
var name = con.query("SELECT name FROM members WHERE id=1");
some function() {
var value = name;
return stuff;
}
console.log(name);
or so?
Thank you.