1
Mazar
Hi, how can i get user email and name using uid?
  • 2009/8/26 7:18

  • Mazar

  • Not too shy to talk

  • Posts: 191

  • Since: 2009/1/4 0


Hi i want to get the username and email address using the uid
how can query database to get the info using uid

for example i am sending a emal from loged in user to
a selected user which i got only id i want to get the email address of the selected user and send email to only that user


2
Mazar
Re: Hi, how can i get user email and name using uid?
  • 2009/8/26 7:22

  • Mazar

  • Not too shy to talk

  • Posts: 191

  • Since: 2009/1/4 0


i am using simple query but i wanted to use objects to query and get. it is working with simple query

3
ghia
Re: Hi, how can i get user email and name using uid?
  • 2009/8/26 9:41

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


$user=new xoopsUser($uid);
$mail $user->email();

4
trabis
Re: Hi, how can i get user email and name using uid?
  • 2009/8/26 14:09

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


require_once XOOPS_ROOT_PATH '/kernel/user.php';
$user = new xoopsUser($uid);
$mail $user->email('n');


or

$member_handler =& xoops_getHandler('member');
$user $member_handler->getUser($uid);
$mail $user->email('n');


Second approach is better because it may avoid a sql query if that member was already asked before.

You should use 'n' so you get exactly what is on the database.

If you do not use 'n' than the $mail will become a clickable mailto link.

Login

Who's Online

116 user(s) are online (54 user(s) are browsing Support Forums)


Members: 0


Guests: 116


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits