»

LJ::get_userid

LJ::get_userid — Returns a userid given a username.

Use

LJ::get_userid(dbarg, user);

Arguments

  • dbarg. Deprecated; a master database handle ($dbh) or a master/slave set of database handles ($dbs).

  • user. Username whose userid to look up.

Info

Results cached in memory. On miss, does DB call. Not advised to use this many times in a row... only once or twice perhaps per request. Tons of serialized db requests, even when small, are slow. Opposite of LJ::get_username.

Source:

cgi-bin/ljlib.pl

Returns:

Userid, or 0 if invalid user.