Thanks mate. But I am still finding it difficult to convert my above logic
to make it async and return login data. I think I need to use multiple
callback.
On Wednesday, March 29, 2017 at 2:00:20 PM UTC-5, Julia Y wrote:
>
> Hi there, I don't know, will it be interesting for you, but think that
login function
> con.execQuery initiates query
> return from login function (result variable is still empty array)
>
>
> later:
>
> node event loop invokes the callback
> rows is assigned to result variable (too late, login returned before)
>
>
> On Tuesday, March 2
How do you guys use node js vars. Please refer to red marking. I am
declaring variable at one place trying to use at another place, simply not
working.
function login(email,password){ // Returns the login data row
var email = email.trim().toLowerCase();
var password = password.trim();
Hi,
I have requriement to return array from node js I want to retrun result
like below. Any help will be appreciated.
[ 'SUCCESS','','Msg','DB connection was successful']
Calling file
var fn = require("./sql.js");
var mysql = require("mysql");
var con = mysql.createConnection({
host: