MyBB Community Forums

Full Version: Get User ID from username.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
(2012-11-10, 08:30 AM)crazy4cs Wrote: [ -> ]You're making it complex, unless I am understanding different.

You can just grab input username and derive various other values from it including uid using get_user function, which already does the query job.

$username = $db->escape_string($mybb->input['username']);
$user = get_user($username);
$uid = $user['uid']; //Similarly you can derive all values from user table, like $user['ipaddress'], etc

The get_user function's input is the uid, not the username.
Pages: 1 2