上传到网络服务器时出现mysqli_num_rows错误[重复]

I have the following piece of code:

$query = "SELECT * FROM delegations where EMail='". $_REQUEST["user"] ."' AND Password = '". Encrypt($_REQUEST["pass"]) ."' ";
$results = mysqli_query($con, $query);

if(mysqli_num_rows($results) > 0) {

    while($row = mysqli_fetch_array($results)) {

        $_SESSION["login"] = $row["ID"];
        echo "Welcome <b>" . $row["FirstName"] . "</b>! You have logged in succesfully! <a href=\"index.php\">Click here</a> to continue!";

    }

Which runs fine when I run it on my localhost xampp. However, when I upload it to my web-server I get the following error code:

Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result,
boolean given in *path*/login.php on line 28

Any suggestions?

</div>

Your mysqli_query is failing, please add a error handler to display the error.

$results = mysqli_query($con, $query) or die(mysqli_error($con));
$results = mysqli_query($con, $query) or die(mysqli_error( $con ));

I think $results should be false; Using mysqli_error you can track this.

otherwise check

var_dump($results);