Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function login($user,$pass) {
- $sql = "SELECT username,password FROM user WHERE username=:user and password=:pass";
- try {
- $db = getConnection();
- $stmt = $db->prepare($sql);
- $stmt->bindParam("username", $user);
- $stmt->bindParam("password", $pass);
- $stmt->execute(array(':username' => $user, ':password' => $pass));
- $db = null;
- echo '{"Report":{"Sukses"}}';
- } catch(PDOException $e) {
- echo '{"Report":{"Gagal"}}';
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement