Не работает строка
Не работает строка while ( $row =mysqli_fetch_assoc($query) ) {echo $row["name"];}
Выдает ошибку:
Warning: mysqli_fetch_assoc() expects parameter 1 to be mysqli_result, bool given in C:\xampp\htdocs\kinomonster\index.php on line 31
https://yadi.sk/i/ynhuoL6Co_eQ5Q
https://yadi.sk/i/T0GYZ3EeP19qLw
код:
<?php
$mysqli = new mysqli("localhost", "root", "", "kino");
if (mysqli_connect_error()) {
printf("Соединение не установлено", mysqli_connect_error());
exit();
}
$query = $mysqli->query("SELECT * FROM movie");
//array mysqli_fetch_assoc( mysqli_result $result )
while ( $row =mysqli_fetch_assoc($query) ) {
echo $row["name"];
}
$mysqli->close();
?>