With the existing output I have from a basic query, what would be the best way to get the names of the columns in the resultant output object without having to run an additional COLUMNS query on the database - in order to save database calls?
$db = JFactory::getDbo();
$query = $db->getQuery(true);
$query->select('*');
$query->from('#__table');
$db->setQuery($query);
$results = $db->loadObjectList();
----
foreach($results as $key=>$value)
{
echo $key;
}
It returns an object, but none of my attempts to get the key from key => value seem to be working, even with a foreach loop. I don't want to run extra queries just to get my keys. How would I do this with the existing output from $results?