This is my first post.
I am trying to check with my MySQL Database to see if the user is a admin or a regular user, it always says that I am an admin. My database is:
id name email password role
I have a test user which is: id: 1 name: admin email: admin@admin.com role: 2
My code is:
<?php if (isset($_SESSION['usr_id']) || $row["role"] = 1) { ?>
<!DOCTYPE html>
<html>
<head>
<h2>You are a admin!</h2>
</head>
</html>
<?php } else { ?>
<h2>You are either not logged in, or you have no access to this page.</h2>
<?php } ?>
However, it always says that I am a admin even if my role is 2!