Can someone hellp me out here? I keep getting this message:
Warning: Cannot use a scalar value as an array in /data/.../class.cart.php on line 56
Here's the code:
function addCartItem($name, $color, $size) {
global $database;
$sql = "SELECT product_id FROM products WHERE product_name='$name' AND product_color='$color' AND product_size='$size' LIMIT 1";
$result = $database->query($sql);
$row = mysql_fetch_array($result);
/* LINE 56 BELOW */
$_SESSION['cart'][$row['product_id']] = ( $_SESSION['cart'][$row['product_id']] + 1 );
return TRUE;
}