Nó bị lỗi như vậy tại dòng 181 mình có đánh dấu
Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, bool given
code:
if(isset($_GET['brands']))
{
$branchecked = [];
$branchecked = $_GET['brands'];
foreach($branchecked as $rowbrand)
{
// echo $rowbrand;
$products = "SELECT * FROM `products` WHERE `type_id` LIKE ? IN ($rowbrand)";
$products_run = mysqli_query($con, $products);
if(mysqli_num_rows($products_run) > 0) //line 181
{
foreach($products_run as $proditems) :
?>
<div class="col-sm-4">
<div class="product-image-wrapper">
<div class="single-products">
<div class="productinfo text-center" style="height:360px">
<a href="detail.php?id=<?php echo $proditems['ID'] ?>">
<img class="img-fluid img-products" style="width: 250px; height: 200px"
src="images/<?php echo $proditems['pro_image'] ?>" alt="" >
<p class="title-products "><?php echo $proditems['name'] ?></p>
<p class="price-products"><?php echo number_format($proditems['price']) ?> VND
</p>
<a href="cart.php?id=<?php echo $proditems['ID'] ?>"
class="btn btn-default add-to-cart"><i
class="fa fa-shopping-cart"></i>Thêm vào giỏ</a>
</a>
</div>
</div>
</div>
</div>
<?php
endforeach;
}
}
}