SOLVED: Lookup USERNAME by ID

For Joomla! 2.5 Coding related discussions, please use: http://groups.google.com/group/joomla-dev-general
Note: All 1.6, 1.7 and 3.5 releases have reached end of life and should be updated to 3.x.

Moderator: ooffick

Forum rules
Please use the mailing list here: http://groups.google.com/group/joomla-dev-general rather than this forum.
Locked
CONTEHHH
Joomla! Apprentice
Joomla! Apprentice
Posts: 12
Joined: Sat Apr 21, 2012 5:22 am

SOLVED: Lookup USERNAME by ID

Post by CONTEHHH » Sat May 05, 2012 11:40 pm

hello, i have a list and different users are displayed in different fields.

currently, i run the user id through the database to return their username.

does joomla have a method to call up a username based on a user id?

like

userbase->id->123 = john
userbase->id->124 = bob

if not, it should!

SOLVED: didnt search hard enough :P

Code: Select all

$user = JFactory::getUser($userid);
$username=$user->get('username');
echo $username.'!';

Locked

Return to “Joomla! 2.5 Coding”