我的代码存在问题我想显示查询结果,但不能正常工作($run_user['user_name'];
部分)。
if(isset($_POST)){
$email = $_POST['email'];
$pass = $_POST['pass'];
$sel_user = "SELECT * FROM users WHERE user_email='$email' AND user_password='$pass'";
$run_user = mysqli_query($con, $sel_user);
$check_user = mysqli_num_rows($run_user);
if($check_user>0){
$_SESSION["user_name"] = $run_user['user_name'];
echo "<script>alert('logged in')</script>";
}
else {
echo "<script>alert('Email or password is not correct, try again!')</script>";
}
}