$db = JFactory::getDbo();
$user = JFactory::getUser();
$query = $db->getQuery(true);
$query->where($db->quoteName('username') . " = ". $db->quote($user->username));

$result = $db->loadResult();

$row = $db->loadrow();

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?

1 Answer 1


The reason being is because you are only selecting the username in your database query. So try changing this:


to this


Hope this helps


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.