append associative array to session, losing assoc values...
Posted: Tue Apr 03, 2007 3:30 pm
why is it that when i add an item to my shopping cart, it loses the associative values???
here are the values of the arrays;
Code: Select all
if(isset($_POST)){
$_SESSION['shopping_cart'][] = $_POST;
}Code: Select all
POST ARRAY:
Array
(
[id] => 12
[name] => Sandwich
[price] => 6.5
[quantity] => 1
[ingredients] => Array
(
[0] => mayonnaise
[1] => lettuce
[2] => tomatoes
[3] => cheese
)
)
SESSION ARRAY:
Array
(
[session_id] => 299c29cfa3ed5119f8b383455de1117d
[shopping_cart] => Array
(
[0] => Array
(
[0] => 1
[1] => 6.5
[2] => 12
[3] => Sandwich
[4] => Array
(
[0] => mayonnaise
[1] => lettuce
[2] => tomatoes
[3] => cheese
)
)
)
)