I got notice that says
Notice: Array to string conversion in C:\xampp\htdocs\PROJEKTBS\cart.php on line 62
Fatal error: Uncaught Error: Call to a member function fetch_assoc() on bool in C:\xampp\htdocs\PROJEKTBS\cart.php:64 Stack trace: #0 {main} thrown in C:\xampp\htdocs\PROJEKTBS\cart.php on line 64
and my sources are
<?php
$total = 0;
if(!empty($_SESSION['cart'])){
$conn = new mysqli('localhost', 'root', '', 'tbodyshop');
$index = 0;
if(!isset($_SESSION['qty_array'])){
$_SESSION['qty_array'] = array_fill(0, count($_SESSION['cart']), 1);
}
$sql = "SELECT * FROM produk WHERE id_produk IN (".implode(',',$_SESSION['cart']).")";
$query = $conn->query($sql);
while($row = $query->fetch_assoc()){
?>
line 62 is $sql
Aucun commentaire:
Enregistrer un commentaire