I am currently working on a cms system with a ranking system, so what I have to make is something that can verify what user is logged in.
Let's say that my db goes like this:
name | rank|
Brian| 1 |
Alex | 2 |
So I want everyone with rank = 1 to see this:
Hallo, you're rank 1!
and everyone with rank = 2 to see this:
Hallo, you're not rank 1!
So far I have made this code:
// Connects to your Database
require_once('connectvars2.php');
$get = mysql_query("SELECT * FROM login WHERE name = '$name'");
while ($row = mysql_fetch_assoc($get))
{
$rank = $row['rank'];
}
if ($_SESSION['rank']=="1") {
echo 'You are rank 1!';
}
This post does not really give me anything except that it doesn't post out that I'm rank 1.
Even though I am logged in with a name with rank 1.
Any ideas what can be the problem?
Thanks in advance!

New Topic/Question
Reply



MultiQuote







|