I am trying to make a verification for my $_POST to database on PHP. I noticed something very strange. Whenever i use if(isset($_POST['login_btn'])), it gets authenticated, but when i use if(!empty($_POST['login_btn'])), notice that it never gets authenticated (NO WARNING as normal on !empty()...) But why is it not working on the same code? Isn't it both same and intercgangeable?
Here is my code i tried to get it to work.......Is there a difference in its application and working that i don't know?
if(!empty($_POST['submit'])){
$username = $_POST["username"];
$password = $_POST["password"];
include 'dbconnect.php';
$conn = "select * from USERS where password='$password' AND (username='$username')";
$result = mysqli_query($db, $conn);
$projects = array();
if(mysqli_num_rows($result) == 1) {
$projects || $logged_in_user = mysqli_fetch_assoc($result);
...........// other codes