I tried take user-level from my database, and check what the level of the user. When I try do this:
include "../web/config.php";
$adminTrueQuery = mysql_query("SELECT * FROM `users` WHERE `Username` = '$admin_username' AND `Password` = '$admin_password' LIMIT 1;");
$adminLevel = mysql_fetch_array($adminTrueQuery);
$adminLevel = $adminLevel['Level'];
if($adminLevel !== "c" || "b") {
throw new Exception ("You don't admin {$adminLevel}"); // return
}
I get an error. And
$adminLevel = "c";
What the problem?
Aucun commentaire:
Enregistrer un commentaire