Please Log in to join the conversation.
//<code>
$user = JFactory::getUser();
$db = JFactory::getDbo();
$userId = $user->get('id');
// Is the user logged in?
if ($userId) {
// Grab the value from the database.
$db->setQuery("SELECT `email` FROM `#__users` WHERE `id`='".$userId."'");
return $db->loadResult();
}
//</code>
//<code>
$user = JFactory::getUser();
$db = JFactory::getDbo();
$userId = $user->get('id');
// Is the user logged in?
if ($userId) {
// Grab the value from the database.
$db->setQuery("SELECT `name` FROM `#__users` WHERE `id`='".$userId."'");
return $db->loadResult();
}
//</code>
Please Log in to join the conversation.
Please Log in to join the conversation.