LJ::get_username

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

Use

LJ::get_username(user);

Arguments

  • 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_userid.

Source:

cgi-bin/LJ/User.pm

Returns:

Userid, or 0 if invalid user.