I'm running the following code on Node.js
and
I am trying to use mysql
with nodejs
: trying to run the query: select numbers from TABLE
. The result comes out as:
"undefined"
function getNumbers()
{
cio.query("SELECT numbers FROM rooms WHERE durum='1'", function(err, result)
{
if (err)
throw err;
else
result[0].numbers;
});
}
var kar = getNumbers();
console.log(kar);
So, what should I do ? Please help.