lifesourcerec
02-26-2003, 10:05 AM
Erwin was kind enough to give me a code he used for a top 10 points hack. Here is the code:
//Top 10 Most Points - Erwin
$toppoints = $DB_site->query('
SELECT user.userid, username, fieldXX
FROM user
LEFT JOIN userfield USING (userid)
ORDER BY fieldXX DESC LIMIT 10
');
while ($topb5top = mysql_fetch_array($toppoints)):
++$topb5topnbsp;
$topbname .= "<a href=member.php?s=$session[sessionhash]&action=getinfo&userid=$topb5top[userid]>$topb5top[username]</a><br>";
$topbpost .= "$topb5top[fieldXX]<br>";
endwhile;
My problem is, it only takes the first number of the points. So after 9 points, the top 10 goes back to seeing 10 as 1 (as if the number behind the first one is a decimal).
//Top 10 Most Points - Erwin
$toppoints = $DB_site->query('
SELECT user.userid, username, fieldXX
FROM user
LEFT JOIN userfield USING (userid)
ORDER BY fieldXX DESC LIMIT 10
');
while ($topb5top = mysql_fetch_array($toppoints)):
++$topb5topnbsp;
$topbname .= "<a href=member.php?s=$session[sessionhash]&action=getinfo&userid=$topb5top[userid]>$topb5top[username]</a><br>";
$topbpost .= "$topb5top[fieldXX]<br>";
endwhile;
My problem is, it only takes the first number of the points. So after 9 points, the top 10 goes back to seeing 10 as 1 (as if the number behind the first one is a decimal).