我有这个功能:
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'];
}
如果我手动查询数据库,它会返回 2 列:
login top_referers
earl73 101
yadatoo 100
kamalancien 88
lolatyou 61
wesllys1as 51
如何返回这两列,然后将它们显示在表格中?