Forums

GetUser again!

medaacek 17 May, 2010
Hello, I cannot work out how to display the user name in the Choroconnectivity. I have searched for quite a while the whole forum.
Im displaying the data from Chronoforms - the database table has a field "cf_user_id" showing the user id

when I use the following code in Chronoconnectivity Body, I get the error "JUser::_load: User does not exist":

<?php
$user =&JFactory::getUser('{cf_user_id}');
echo $user->name;
?>


the following code gives of course the name of the currently logged user:

<?php
$user =&JFactory::getUser();
echo $user->name;
?>


Does anybody know how to display the name of the user saved in the database? I really have not found the solution in forum.

Thanks a lot in advance

Jiri
GreyHead 17 May, 2010
Hi Jiri,

Try
$user =&JFactory::getUser($MyRow->cf_user_id);

Bob
medaacek 17 May, 2010
It works - how easy! Thanks a lot again Bob!
This topic is locked and no more replies can be posted.