If i have this table on dataBase.js file:
client.query(
'CREATE TEMPORARY TABLE IF NOT EXISTS '+USER+
'(username VARCHAR(255), '+
'password VARCHAR(255), '+
'name VARCHAR(255), '+
'picture VARCHAR(255), '+
'PRIMARY KEY(username))'
);
and lets say i want to check if i have a given user already in my dataBase,
how can i get the data after running the following query? :
function checkUser(username,password){
client.query('SELECT username, password FROM ' + USER + 'WHERE username=?', [username] , 'AND password=?', [password]
function (err, results, fields) {
if (err) {
throw err;
}
});
}
if an error occurred, it will be handled but how can get the needed data?
any help will be much appreciated!
resultsandfieldsvariables.console.log'ing them to see? :)