Shopping Cart/Array Push Problem

Hi all, I’m creating a shopping cart system using sessions but seem to have a small problem. I can add one item to the cart but then when I attempt to add another it won’t - I’m guessing there is something wrong with my array_push? I’m also print_r the session and it’s only displaying one product ID :confused:

if(isset($_POST['add'])){

	if(!isset($_SESSION['CART'])){
	$_SESSION['CART'] = array();
	$_SESSION['CART'] = $_POST['prodId'];
	}
	else {
	$productID = mysql_real_escape_string($_POST['prodId']);
	array_push($_SESSION['CART'], $productID);
	}
}

Hey guys, managed to fix it after some hair pulling! If any Googler should stumble across this, here is my solution:

if(isset($_POST['add'])){

	//Initialize the array...
	if(!isset($_SESSION['CART'])):
	$_SESSION['CART'] = array();
	endif;

	$productID = mysql_real_escape_string($_POST['prodId']);
	$_SESSION['CART'][] = $productID;
}

What’s the best way to do a shopping cart? To store the cart products in database table or to use sessions?