Hello,
I need to show the UserName of the user who last modified a record. I had a look at this post
http://chronoengine.com/forums/posts/f12/t12163
My requirement is slightly different I need to show the name in an output with other data. I know the user id who modified from the field "cf_modified_by" whihch is stored in the table but how do I get the name. Do I have to query the table for each record in the body code. I have written the below code in "body". It doesn't work. Let me know if this is the right way to do it. The SQL seems to be ok. Does Joomla have some function to get username or name from userid.
Thanks
Amal
I need to show the UserName of the user who last modified a record. I had a look at this post
http://chronoengine.com/forums/posts/f12/t12163
My requirement is slightly different I need to show the name in an output with other data. I know the user id who modified from the field "cf_modified_by" whihch is stored in the table but how do I get the name. Do I have to query the table for each record in the body code. I have written the below code in "body". It doesn't work. Let me know if this is the right way to do it. The SQL seems to be ok. Does Joomla have some function to get username or name from userid.
<tr>
<td style="font-weight: bold; color: gray;width: 5%;"><?php global $ll_count; echo $ll_count++; ?></td>
<td style="width: 15%;"><strong>{ip_text_first_name}</strong></td>
<td style="width: 15%;"><strong>{ip_text_last_name}</strong></td>
<td style="width: 5%; text-align:right;">{cf_modified_by},
<?php
$db =& JFactory::getDBO();
$queryN = "SELECT id, name, username FROM `jos_users` WHERE `id` = '{cf_modified_by}'";
$db->setQuery($queryN);
$rowN = $db->loadObject();
//echo $queryN;
echo $rowN->name;
?>
</td>
</tr>
Thanks
Amal