A user will select a tournament to register for, then add a team, then I store the following into a session:
$teamID; $tournyID; $gatefee; $cost;
When they click add to cart I update the session using this:
$_SESSION['cart'][]['team'] = $teamID; $_SESSION['cart'][]['tournament'] = $tournyID; $_SESSION['cart'][]['gatefee'] = $gatefee; $_SESSION['cart'][]['cost'] = $cost;
My array comes out like this:
Array ( [cart] => Array ( [] => Array ( [team] => 2137 [tournament] => 24490 [gatefee] => [cost] => 575 )
)
As you can see there is no KEY so when someone adds another tournament to their cart it overwrites this one. How can I get the KEY to number 0, 1, 2, etc... with each addition to the cart?
Thanks in advance!!!!
$_SESSION['cart'][] = array('team'=> $teamID,'tournament'=>$tournyID,'gatefee'=>$gatefee,'cost' => $cost);
Note the code tags!