MyBB Community Forums

Full Version: Username from UID
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey, can anyone tell me how to get a members Username given their UID?

I already have the MyBB global.php defined if that's any help, it's already there to check who is logged in.
$query = $db->simple_select(TABLE_PREFIX."users", "username", "uid = '{$uid_variable_here}'");
$username = $db->fetch_field($query, "username");

Cheers
Thanks.