i am developing a node.js applicaton where i am using the node-mysql connector. This is how i am retrieving the data:
var queryString2 = "SELECT * FROM table WHERE domain = 'xyz';"
conn.query(queryString2, function (error,results2)
{
if(error)
{
throw error;
}
else
{
abc = results2;
console.log(abc); //this works
}
}
)
console.log(abc); //this does not work
My question is how do i access the value of abc outside of the conn.query function?