Ошибка:Warning
: mysqli_fetch_array() expects parameter 1 to be mysqli_result, null given in
D:\OpenServer\domains\Site\products.php
on line
431
Строка 431 - while($row = mysqli_fetch_array($result)) { ?>
<?php
include_once "php/connect.php";
?>
<?php
$query = "SELECT * FROM products";
$results = mysqli_query($connect, $query);
while($row = mysqli_fetch_array($result)) { ?>
<div class="product__block">
<div class="product__block--img">
<img src="images/<=? $row ['image']?>" alt="">
</div>
<div class="product__block--info">
<div class="product__block--info--info">
<div class="product__block--title"><?= $row['name']; ?></div>
<div class="product__block--cost"><?= $row['cost']; ?></div>
</div>
<button class="product__block--info--like">
<img src="images/Header/heart .svg" width="30" height="30" alt="">
</button>
</div>
<div class="product__block--buy">
<button class="product__buy--button">Купить</button>
</div>
</div>
<?php }
?>
Вот код connect.php
<?php
$connect = mysqli_connect('localhost','root','root','registerAndLogin');
if (!$connect){
echo "Ошибка - ".mysqli_connect_error();
}
?>