После загрузки сайта на хостинг www.zzz.com.ua выдает ошибку:
Fatal error: Call to a member function fetch_assoc() on boolean in /profiles/m/my/myf/myfamily/myfamilyz.zzz.com.ua/php-vendor/login.php on line 11
<?php
$name = filter_var(trim($_POST['name']));
$password = filter_var(trim($_POST['password']));
$password = md5($password);
mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
$dbconnect = new mysqli( 'хост', 'имя', 'пароль', 'название БД' );
$result = $dbconnect->query("SELECT * FROM `Users` WHERE `name` = '$name' AND `password` = '$password'");
$user = $result->fetch_assoc($result);
if(count($user) == 0) {
echo "User is not found:(";
exit();
}
setcookie('user', $user['name'], time() + 3600, "/");
setcookie('email', $user['email'], time() + 3600, "/");
setcookie('members', $user['count_members'], time() + 3600, "/");
$dbconnect->close();
header('Location: ../php-blocks/home.php');
До загрузки на хостинг все работало.