Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function login($email,$password)
- $outcome;
- $conn;
- $servername = ...
- $username = ...
- $password = ...
- $database = ...
- try {
- $conn = new PDO(...);
- $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
- $conn->setAttribute( PDO::ATTR_EMULATE_PREPARES, FALSE );
- } catch(PDOException $e) {
- $outcome = "Connection failed: " . $e->getMessage();
- return $outcome;
- die();
- }
- $sql = "SELECT * FROM `users` WHERE user_email = ?";
- $stmt = $conn->prepare($sql);
- $stmt->execute(array($email));
- $user = $stmt->fetch(PDO::FETCH_ASSOC);
- ...
Add Comment
Please, Sign In to add comment