My column type is SMALLINT and name is user_level.
Here is the code I am using:
<?php
mysql_connect("localhost", "root", "*********");
mysql_select_db("3591_other");
$result = mysql_query("SELECT * FROM rivase_f_users WHERE user_name = '$email' AND user_pass=sha1('$passwd')");
if (!$result) {
echo mysql_error();
}
//snip
else if (mysql_fetch_assoc($result)) {
$row=mysql_fetch_assoc($result);
$_SESSION['username']=$email;
if ($row['user_level']==1) {$_SESSION['usertype']='leader';}
header("Location: index.php");
die();
}
?>
$row['user_level'] looks like to be null, but phpmyadmin says it is 1. I tried echoing it with commenting the header-location row, it did not say anything. What am I doing wrong?
mysql_*functions. BtwWHERE user_name = '$email'Did you read this????