You are here

function _username_check_is_user_exists in Username originality AJAX check 8

Same name and namespace in other branches
  1. 5 username_check.module \_username_check_is_user_exists()
  2. 6 username_check.unique.inc \_username_check_is_user_exists()
  3. 7 username_check.unique.inc \_username_check_is_user_exists()

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

2 calls to _username_check_is_user_exists()
username_check_callback in ./username_check.unique.inc
Main AJAX function: originality check menu callback.
username_check_profile_callback in ./username_check.unique.inc
Main AJAX function: originality check menu callback for user profile

File

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

Code

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