Advertisement
Guest User

Untitled

a guest
Jul 28th, 2015
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. function getUserIdByEmail($email) {
  2. $stmt = $this->conn->prepare("SELECT id FROM user WHERE email = ?");
  3. $stmt->bind_param("s", $email);
  4. if ($stmt->execute()) {
  5. // $user = $stmt->get_result()->fetch_assoc();
  6. $stmt->bind_result($id);
  7. $stmt->fetch();
  8. $userid = $id;
  9. $stmt->close();
  10. return $userid;
  11. } else {
  12. return NULL;
  13. }
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement