function db_get_user_id

7.x db.inc db_get_user_id($user_name)
6.x db.inc db_get_user_id($user_name)
4.x db.inc db_get_user_id($user_name)
5.x db.inc db_get_user_id($user_name)

Look up the user_id based on the the user_name. Returns FALSE if it cannot find it.

Parameters

unknown_type $user_name:

File

includes/db.inc, line 525
This file contains mostly db shortcuts.

Code

function db_get_user_id($user_name) {
  $user_id = db_result(db_query("SELECT user_id FROM users WHERE user_name = '?' ", $user_name));

  if ($user_id) {
    return $user_id;
  }

  return FALSE;

}