Welcome Guest, Not a member yet? Register   Sign In
multidimensional session
#5

[eluser]ciGR[/eluser]
I misunderstand what exactly you want.
the simple occasion is

Code:
$row => array(
            'basket_id'=>'1',
            'order_id'=>'1',
            'cus_id'=>$cusid,
            'product_id'=>$pro_id,
            'bas_quantity'=>1
    )

$cart = array($row);

$this->session->set_userdata('cart',$cart);
to add a new row just get the array from the session and add a new row
Code:
//get the cart
$cart = $this->session->userdata('cart');

//create the new row
$new_row => array(
            'basket_id'=>'2',
            'order_id'=>'2',
            'cus_id'=>$cusid,
            'product_id'=>$pro_id,
            'bas_quantity'=>1
    )

//add new row to cart
$cart[] = $new_row;

//or you can set it with a key, for find easier a session row by a id
// $cart[$pro_id] = $new_row;

//save cart to session
$this->session->st_userdata('cart',$cart);
also you can see the CI cart library if it can help you


Messages In This Thread
multidimensional session - by El Forum - 03-28-2010, 02:40 AM
multidimensional session - by El Forum - 03-28-2010, 04:48 AM
multidimensional session - by El Forum - 03-30-2010, 11:54 AM
multidimensional session - by El Forum - 03-31-2010, 01:01 AM
multidimensional session - by El Forum - 03-31-2010, 04:56 AM
multidimensional session - by El Forum - 03-31-2010, 05:14 AM



Theme © iAndrew 2016 - Forum software by © MyBB