I'm not really familiar with this type of stuff in PHP, however it isn't working too well. Before I share the code and what the issue is, let me tell you what my goal is. My goal is to have a ENUM selection in the database with values: '1','2','3' , 1 being a normal user, 2 being a moderator and 3 being administrator.
Here is the code:
$checkpermission = mysql_query("SELECT permission FROM users ");
$checkpermnrows = mysql_num_rows($checkpermission);
if ($checkpermnrows != 0) {
if ($checkpermission == 2) {
echo "User Group: Moderator";
} else {
echo "User Group: User";
}
} else {
echo "Rows not found";
}
if someone could also lecture me on how to setup sessions for this type of stuff, i'm pretty sure that would be better...