Jump to content

[SOLVED] My rank system won't work


marklarah

Recommended Posts

You're probably all bored by now of all my problems, but anyway, for the rank system on my site, on my include file, i have this:

 

    $userlevel = $_SESSION['lvl'];

$qry = mysql_query("SELECT * FROM `ranks` WHERE `number` = '$userlevel'");
  $rowq = mysql_fetch_array($qry);

$userrank = $rowq['title'];

 

which should work.

 

I have this on the page i want to display it:

 

<table width="98%" align="center" border="1">
<?
  while ($tnum = mysql_fetch_assoc($tarticles)){



$userp = $tnum['username'];
$message = $tnum['message'];
echo '<tr><td width="22%" align="center">'; 


echo $userp;


echo '</td><td width="78%" align="left">';
echo "Stuff";
echo '</td></tr>';


echo '<tr><td width="22%" height="'.$height.'" valign="top" align="center">';
// $userp = $rowl['username'];
// $message = $rowl['message'];



echo '<b>'.$userrank.'</b>';
echo 'Level: '.$userlevel;
echo '</td><td wdth="78%" height="'.$height.'" valign="top" align="left">';

echo $message;
echo '</td></tr>';
}



?>
</table>

 

It only displays the level, not the rank title, also i get this from the include file:

 

Warning: mysql_query() [function.mysql-query]: Access denied for user 'tlscom'@'localhost' (using password: NO) in /home2/tlscom/public_html/bar.php on line 138

 

Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /home2/tlscom/public_html/bar.php on line 138

 

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home2/tlscom/public_html/bar.php on line 139

 

And yes, I can connect to my database fine.

 

 

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/86699-solved-my-rank-system-wont-work/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.