我具備的功能:PHP MySQL的函數返回多個值
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
如何退還這兩列然後將它們顯示在表格中?
我不認爲這是工作代碼。 – Evert
我在做什麼錯了? – CustomNet
'$ top_refs'從哪裏來? – asprin