View Full Version : rank error

03-14-2007, 06:33 PM
hey ive got a game but the ranks arent working. heres the scripts.

<?php session_start(); include_once"includes/db_connect.php"; include_once"includes/functions.php"; logincheck();
$query=mysql_query("SELECT * FROM users WHERE username='$username'");
echo mysql_error();

$query1=mysql_query("SELECT * FROM user_info WHERE username='$username'");
echo mysql_error();

$rankp = $fetch->rankpoints;

if ($currank == "Scum"){
$max = "500";
}elseif ($currank == "Package Boy"){
$max = '1000';
}elseif ($currank == "Pee Wee"){
$max = '1500';
}elseif ($currank == "Thug"){
$max = '2000';
}elseif ($currank == "Crook"){
$max = '2500';
}elseif ($currank == "Thief"){
$max = '3000';
}elseif ($currank == "Local Boss"){
$max = '3500';
}elseif ($currank == "Boss"){
$max = '4000';
}elseif ($currank == "Respectable Boss"){
$max = '4500';
}elseif ($currank == "Don"){
$max = '5000';

}elseif ($currank == "Respected Don"){
$max = '4500';
}elseif ($currank == "Legendary Don"){
$max = '6000';

}elseif ($currank == "Godfather"){
$max = '6500';
}elseif ($currank == "Godmother"){
$max = '8000';
$percent = round((($rankp-$old)/($max-$old))*100);
echo mysql_error();

<?php echo "$style"; ?>
<center><b>Your Status</center></b>
<td height="34" valign="top"> <table width="70%" align="center" border="1" cellpadding="2" cellspacing="0" class=thinline bordercolor="black">
<td background="includes/grad.jpg">
<center>Your Current Rank:</center></td>
<center> <?php echo "$fetch->rank"; ?></center>


<table width="100%" border="1" cellpadding="2" cellspacing="0" bordercolor="#000000" bgcolor="#666666">
<p align="center" background="includes/grad.jpg"><strong>Rank Bar:</strong></p>
<td height="76">
<table width="<? echo $percent; ?>%" height="70" border="1" cellpadding="0" cellspacing="0" bordercolor="black" bgcolor="green">
<td width="<? echo $percent; ?>%" height="53">&nbsp;<font color="black" size="5"><strong><? echo "$percent";print "%"; ?>
</strong></font> </td>

$percent = round((($rankp-$old)/($max-$old))*100);

that is the error.
it appears to be doing it only with admins and mods. as they only have the rank "mod" and "administrator"

03-14-2007, 06:55 PM


So what's your question?