joom 0 Posted June 16, 2013 Report Share Posted June 16, 2013 Hello, I get the following error after clicking on the add to cart link in ch5: Fatal error: Unsupported operand types in C:\Program Files (x86)\EasyPHP-5.3.8.1\www\\Ch05\cart.php on line 127 The line is: $subtotal = $_SESSION['cart'][$row['sw_id']] * $price; What is the problem? Thanks Quote Link to post Share on other sites
margaux 171 Posted June 16, 2013 Report Share Posted June 16, 2013 use var_dump on the variables to ensure both are of type integer. You may need to typecast one or both of them. int($_SESSION['cart'][$row['sw_id']]) 1 Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.