$db = JFactory::getDbo();
$user = JFactory::getUser();
$query = $db->getQuery(true);
$query->select('username');
$query->from($db->quoteName('#__selected_packages'));
$query->where($db->quoteName('username') . " = ". $db->quote($user->username));
$db->setQuery($query);
$result = $db->loadResult();
$row = $db->loadrow();
print_r($row);
The output looks something like this:
Array (
[0] => any_username
)
It only displays one column, but according to Joomla Docs it should display the whole row somewhat like this:
Array (
[0] => any_username
[1] => val_of_col1
[2] => val_of_col2
[3] => val_of_col3
)
Where am i wrong with the code?
Moreover, is there any way to display the row data in a HTML table?