I have the function:
function get_top_refs()
{
global $db;
$top_refs = $db->EscapeString($top_refs);
$top_referers = $db->QueryFetchArray("SELECT login, COUNT(*) AS top_referers FROM users WHERE ref > 0 GROUP BY ref ORDER BY top_referers DESC LIMIT 5");
return $top_referers['top_referers'];
}
And if I manually query the database it comes back with 2 columns:
login top_referers
earl73 101
yadatoo 100
kamalancien 88
lolatyou 61
wesllys1as 51
How do I return both of these columns and then display them in a table?
Change your return value from
return $top_referers['top_referers'];toreturn $top_referersThen use this to get your values :