Guest User

Untitled

a guest
Jan 21st, 2018
1,075
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.62 KB | None | 0 0
  1. function checkUserLogon ( $username, $password ) {
  2.         $statement = $this->mysqli->stmt_init();
  3.         if ( $statement->prepare(
  4. 'SELECT id, username, date_created FROM users WHERE username=? AND password=? ' ) ) {
  5.             $statement->bind_param("ss", $username, $password);
  6.             $statement->execute();
  7.            
  8.             if ( $statement->affected_rows == 1 ) {
  9.                 $statement->bind_result($this->user_id, $this->user_name, $this->user_date_created);
  10.                 $statement->fetch();
  11.                 return TRUE;
  12.             }
  13.         } else {
  14.             return FALSE;
  15.         }
  16.     }
Add Comment
Please, Sign In to add comment