You are here

function _username_check_is_mail_exists in Username originality AJAX check 7

Same name and namespace in other branches
  1. 8 username_check.unique.inc \_username_check_is_mail_exists()

Query user table to check if such mail is already exists.

1 call to _username_check_is_mail_exists()
username_check_mail_callback in ./username_check.unique.inc
Main AJAX function: originality check menu callback for email.

File

./username_check.unique.inc, line 151
AJAX callbacks for the username_check module.

Code

function _username_check_is_mail_exists($mail) {
  return db_query("SELECT COUNT(u.mail) count FROM {users} u WHERE LOWER(u.mail) = LOWER(:mail)", array(
    ':mail' => $mail,
  ))
    ->fetchField();
}