joomla 2.5 get user name from users table

get user name from jos_users table of joomla 2.5 

 

$query = $db->getQuery(true);
$query->select(‘TOP ‘.$no_top_row.’ c.id as blg_id,c.title as post_title,c.introtext as post_content,c.created_by,c.publish_up as post_date’);
$query->from(‘#__content as c’);
$query->innerJoin(‘#__categories as d on c.catid=d.id’);
$query->where(‘d.parent_id=89 AND c.state=1’);
$query->order(‘c.id DESC’);
$db->setQuery($query,0);
$result_top = $db->loadObjectList();

 

foreach ($result_top as $results){

//$author_names =& JFactory::getUser($results->created_by);
$author_names->name

}

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s