Как исправить warning: mysqli_fetch_assoc() expects parameter 1 to be mysqli_result?
0
Не понимаю в чём ошибка, "Warning: mysqli_fetch_assoc() expects parameter 1 to be mysqli_result, bool given in C:\xampp\htdocs\kinomonster\player.php on line 13"?
<?php
$mysqli = new mysqli('localhost', 'root', '', 'kinomonster');
if (mysqli_connect_errno()) {
printf("Соединение не установлено", mysqli_connect_error());
exit();
}
$mysqli->set_charset('utf8');
$query = $mysqli->query('SELECT * FROM music');
while ($row = mysqli_fetch_assoc($query)) {
echo $row['name'].$row['author']."<br>";
}
?>