Current time: 05-24-2012, 03:19 PM Hello There, Guest! (LoginRegister)


Post Reply 
Is there a function to get username by id?
10-26-2008, 04:12 AM
Post: #1
Is there a function to get username by id?
Is there a built in function to already do this (in admin cp) or would it be better to use simple_query.

Do Follow Proxy Directory
Watch House Now Online For Free
Find all posts by this user
Quote this message in a reply
10-26-2008, 11:51 AM
Post: #2
RE: Is there a function to get username by id?
Can't remember off the top of my head, but a query is very easy to do anyway:
PHP Code:
$uid $db->fetch_field($db->simple_select('users''uid''username="'.$db->escape_string($username).'"'), 'uid'); 
Visit this user's website Find all posts by this user
Quote this message in a reply
10-26-2008, 12:56 PM
Post: #3
RE: Is there a function to get username by id?
PHP Code:
function get_user($uid

In functions.php

Example:
PHP Code:
$u get_user(1);
echo 
$u['username']; 

Find all posts by this user
Quote this message in a reply
10-26-2008, 01:23 PM
Post: #4
RE: Is there a function to get username by id?
^ Oh crap, I read the title round the wrong way :/

Thanks for clearing that up Toungue
Visit this user's website Find all posts by this user
Quote this message in a reply
10-26-2008, 03:23 PM
Post: #5
RE: Is there a function to get username by id?
Oh nice Smile

Do Follow Proxy Directory
Watch House Now Online For Free
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 3 Guest(s)

Contact Us | MyBB | Return to Top | Return to Content | Lite (Archive) Mode | RSS Syndication