I have been looking through the globals,gym a few other files and I realize the global func might be the problem.
Here's the error I keep getting
QUERY ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '373 AND us.userid != 1 AND u.user_level != 0' at line 1
Query was SELECT count(*) FROM userstats us LEFT JOIN users u ON us.userid=u.userid WHERE us.strength > 2,373 AND us.userid != 1 AND u.user_level != 0
Here's the little piece of the globals
function get_rank($stat, $mykey)
{
global $db;
global $ir,$userid,$c;
$q=$db->query("SELECT count(*) FROM userstats us LEFT JOIN users u ON us.userid=u.userid WHERE us.$mykey > $stat AND us.userid != $userid AND u.user_level != 0") ;
return $db->fetch_single($q)+1;
}