Ok, it seems you are assigning the value instead of comparing it. That is the reason why you always log in as an administrator.
Just change $row["role"] = 1
by $row["role"] == 1
. Furthermore, you should use the &&
operator instead of ||
.
Finally, it seems you are learning programming for the first time, and these are typical mistakes that everyone who is programmer had at the beginning. I recommend you the book "PHP: A Beginner's Guide", by Vikram Vaswani, which is an excellent and easy guide for those who are learning to program in PHP.
Good luck.
No comments:
Post a Comment