Advertisement
Guest User

Untitled

a guest
Aug 8th, 2012
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.30 KB | None | 0 0
  1. $sql = $db->prepare("SELECT username,password FROM students WHERE username=? and password=?");
  2. $sql->execute(array($username, $password));
  3. $allRows = $sql->fetchAll(PDO::FETCH_ASSOC);
  4.                                    
  5. if ($sql->count($allRows) == 1){
  6.      $_SESSION['login_user']=$username;
  7.      header("location: index.php");
  8. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement