Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $sql = "SELECT * FROM users WHERE username = ? LIMIT 1";
- $stmt = $pdo->prepare($sql);
- $stmt->execute([$username]);
- while ($rows = $stmt->fetch(PDO::FETCH_ASSOC)){
- $id = $rows['id'];
- $uname = $rows['username'];
- $_SESSION['id'] = $id;
- $_SESSION['user'] = $uname;
- header("Location: welcome.php");
- }
Add Comment
Please, Sign In to add comment