Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.