Dobakat Posted June 12, 2006 Share Posted June 12, 2006 I honeslty don't know what is wrong. But it does not get the rank from the database, it get the rankpoints. but not the rank.. can someone help me..[code] <?phpsession_start();include "includes/db_connect.php";include_once "includes/functions.php";$username=$_SESSION['username'];$mysql=mysql_query("SELECT * FROM users WHERE username='$username'");$fetch=mysql_fetch_object($mysql);$username=$_SESSION['username']; $rankp= $fetch->rankpoints;$currank= $fetch->rank;if ($currank == "Scum"){$max = "90";$old="0";}elseif ($currank == "Pee Wee"){$max = '120';$old="90";}elseif ($currank == "Criminal"){$max = '220';$old="120";}elseif ($currank == "Thug"){$max = '350';$old="220";}elseif ($currank == 'Robber'){$max = '460';$old="350";}elseif ($currank == "Criminal"){$max = '880';$old="460";}elseif ($currank == "Gangster"){$max = '1000';$old="880";}elseif ($currank == "Crimelord"){$max = '1300';$old="1000";}elseif ($currank == "Picciotto"){$max = '3500';$old="1300";}elseif ($currank == "Hitman"){$max = '6500';$old="3500";}elseif ($currank == "Assasin"){$max = '9500';$old="6500";}elseif ($currank == "Boss"){$max = '10900';$old="9500";}elseif ($currank == "Kingpin"){$max = '11800';$old="10900";}elseif ($currank == "Consiglieri"){$max = '12000';$old="11800";}elseif ($currank == "Don"){$max = '14000';$old="12000";}elseif ($currank == "Repectable Don"){$max = '16500';$old="14000";}elseif ($currank == "Legendary Don"){$max = '19500';$old="16500";}elseif ($currank == "Respectable Godfather"){$max = '22200';$old="19500";}elseif ($currank == "Legendary Godfather"){$max = '25500';$old="22200";}elseif ($currank == "Untouchable Godfather"){$max = '27500';$old="25500";}$percent = round((($rankp-$old)/($max-$old))*100, 2);?><body bgcolor="#333333" text="#00CCFF" link="#0033FF" vlink="#0099FF" alink="#0099FF"><p align="center"><strong>Rank Bar(Rounded to 2 decimal places):</strong></p><table width="100%" border="1" cellpadding="2" cellspacing="0" bordercolor="#000000" bgcolor="#666666"> <tr> <td height="76"><table width="80" height="70" border="1" cellpadding="0" cellspacing="0" bordercolor="#000000" bgcolor="#000099"> <tr> <td width="<? echo $percent; ?>%" height="53"> <div align="center"><font color="#000000" size="5"><strong><? echo "$percent";print "%"; ?> </strong></font> </div></td> </tr> </table> </td> </tr></table></body></html>[/code] Link to comment https://forums.phpfreaks.com/topic/11773-help-please/ Share on other sites More sharing options...
Dobakat Posted June 12, 2006 Author Share Posted June 12, 2006 I have notice that when I am rank one, which is Scum it works, but when I am higher it does not. Link to comment https://forums.phpfreaks.com/topic/11773-help-please/#findComment-44563 Share on other sites More sharing options...
d_barszczak Posted June 12, 2006 Share Posted June 12, 2006 [!--quoteo(post=382796:date=Jun 12 2006, 12:51 PM:name=Dobakat)--][div class=\'quotetop\']QUOTE(Dobakat @ Jun 12 2006, 12:51 PM) [snapback]382796[/snapback][/div][div class=\'quotemain\'][!--quotec--]}elseif ($currank == "Criminal"){$max = '220';$old="120";}elseif ($currank == "Thug"){$max = '350';$old="220";}elseif ($currank == 'Robber'){$max = '460';$old="350";}elseif ($currank == "Criminal"){$max = '880';$old="460";}[/quote]Do you know you have 2 if statements looking for criminal? Link to comment https://forums.phpfreaks.com/topic/11773-help-please/#findComment-44564 Share on other sites More sharing options...
Dobakat Posted June 12, 2006 Author Share Posted June 12, 2006 I found my error, it was not in this code I provided. Link to comment https://forums.phpfreaks.com/topic/11773-help-please/#findComment-44567 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.