I keep getting this error when I try to process a shopping cart
Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in
Here's the code section that I've been working on:
//STATEMENTS TO STORE ITEM ORDER
while($row = mysqli_fetch_array($r , MYSQLI_ASSOC)){
$query =
"INSERT INTO order_contents (order_id,item_id,quantity,price)
VALUES ($order_id, ".$row['item_id'].",".
$_SESSION['cart'][$row['item_id']]['quantity'].",".
$_SESSION['cart'][$row['item_id']]['price'].")";
$result = mysqli_query($dbc,$query) or die (mysqli_error($dbc));
}
//CLOSE DB
mysqli_close($dbc);
//MESSAGE
echo "<p>Thanks for your order.<br/>
Your order number is #".$order_id."</p>";
$_SESSION['cart'] = NULL;
}
Any ideas? Thanks