Advertisement
Guest User

Untitled

a guest
Sep 3rd, 2017
1,415
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //check this section code
  2. function login (username, password, callback) {
  3.     var check = false
  4.     accountDB.serialize(function () {
  5.         var sql = 'SELECT username,password FROM table01 WHERE username=?'
  6.         accountDB.each(sql, [username], function(err, row) {
  7.             console.log(':' + row.password)
  8.             if (row.password === password) {
  9.                 check = true
  10.                 console.log('check true')
  11.                 callback(null, true);
  12.             }
  13.             callback('Username or password is wrong', null);
  14.         })  
  15.     })
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement