You are here

function _username_check_is_user_exists in Username originality AJAX check 6

Same name and namespace in other branches
  1. 8 username_check.unique.inc \_username_check_is_user_exists()
  2. 5 username_check.module \_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.

1 call to _username_check_is_user_exists()
username_check_callback in ./username_check.unique.inc
Main AJAX function: originality check menu callback.

File

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

Code

function _username_check_is_user_exists($username) {
  return db_result(db_query("SELECT COUNT(u.name) FROM {users} u WHERE LOWER(u.name) = LOWER('%s')", $username));
}