Log in

View Full Version : populate $myuser with same properties as $userinfo, but for a different user


SDB
08-28-2007, 10:12 AM
Hi

I want to create an array called $myuser with the same structure as that of $userinfo, but for a different user...

Is it as simple as $db->query_first("SELECT * FROM user WHERE userid = 123") ?

The reason I want to do this, is that I want to then test this $myuser with functions such as is_member_of, etc.

Thanks in advance.

Simon

EnIgMa1234
08-28-2007, 11:39 AM
Try $myuser = $db->query_first("SELECT * FROM user WHERE userid = 123");

then your can use $myuser['username'] etc

Dismounted
08-28-2007, 11:40 AM
$myuser = fetch_userinfo(123);

SDB
08-28-2007, 02:14 PM
Thank you Dismounted (again!:))

EnIg

The problem with that method is that it doesn't include the userfields, etc.