I've just created a query to see if users are an admin or not.
I'm not sure if the query does what it's supposed to, but it's saying i have an undefined variable $a.
Who and where do I need to define the $a?
if (isset($_SESSION['user_id']) AND (substr($_SERVER['PHP_SELF'], -10) != 'logout.php'))
{
echo '<a href="logout.php">Logout</a><br />
<a href="link.php">link</a><br />';
$query = "SELECT user_id FROM users WHERE admin='$a'";
$result = mysql_query($query);
if (mysql_num_rows($result) == 1)
{
echo '<a href="morelinks.php">more links</a><br />';
}
}
else
{
//Not logged in.
echo '<a href="register.php">Register</a><br />
<a href="login.php">Login</a><br />
<a href="forgot_password.php">Forgot Password</a><br />';
}