PDA

View Full Version : Little help needed


DjSap
03-21-2002, 12:54 PM
Im working on a toplist thingy for my board, below is my query for getting the sites listed sorted after hits in, what I cant figure out is how to show the sites rank, can anybody help me out?


$toplistbits = $DB_site->query("SELECT * FROM toplist_sites ORDER BY topin DESC");
while ($toplist=$DB_site->fetch_array($toplistbits) and ++$bgcounter) {
$bgcolor=iif($bgcounter%2==0,'{firstaltcolor}','{s econdaltcolor}');
$topid = $toplist[topid];
$title = $toplist[title];
$description = $toplist[description];
$url = $toplist[url];
$in = $toplist[topin];
$out = $toplist[topout];

eval("\$toplistbit .= \"".gettemplate("toplistbit")."\";");
}

Admin
03-21-2002, 01:00 PM
Define 'rank'. :)

DjSap
03-21-2002, 01:02 PM
well their current position on the list

Admin
03-21-2002, 01:04 PM
Ahh, ok. In that case you can just use $bgcounter, since you already have it there in the loop. Make sure you set it to 0 before the loop, tho.

DjSap
03-21-2002, 01:08 PM
it worked, thanx for like the thousand time