我现在的询问:
SELECT * FROM posts as p
INNER JOIN users as u
ON p.author = u.uid
INNER JOIN usergroups as ug
ON u.usergroup = ug.gid
WHERE tid_parent = ?
例如,此查询将提供以下数据:
我喜欢这些排名(使用 @curRank:= @curRank + 1 AS等级)。
答案 0 :(得分:0)
当您循环输出表时,请保持计数并将计数值打印为等级
$c=1;
foreach($results as $result){
//all the table row html
echo $c;
//all rest of table row html
$c++;
}