This error appeared in my index.php where the system checks the admin login and password
Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given in /storage/ssd3/088/16507088/public_html/gotogro/index.php on line 13
Line 13:
if (mysqli_num_rows($results) == 1) {
Piece of code:
<?php
session_start();
require('db.php');
$username="";
$errors = array();
if (isset($_POST['login_user'])) {
$username = mysqli_real_escape_string($conn, $_POST['username']);
$pwd = mysqli_real_escape_string($conn, $_POST['pwd']);
if (count($errors) == 0) {
$query = "SELECT * FROM login WHERE uname='$username' AND pwd='$pwd'";
$results = mysqli_query($conn, $query);
if (mysqli_num_rows($results) == 1) {
$_SESSION['uname'] = $username;
header("location:home.php?info=home");
}else {
array_push($errors, "<div class='alert alert-warning'><b>Wrong username/password combination</b></div>");
}
}
}
?>
This error only appeared when I moved the website to web000host. Worked ok in localhost.