Welcome Guest, Not a member yet? Register   Sign In
CI Session Array Problem
#1

[eluser]mohsin917[/eluser]
Hi.
This is the thing that i do in simple code. Every time when this code runs it create new index of basket in session array and when i want to get data i just do it with simple loop.
Now i want to do it in CI using session class

Code:
$product_array = array(
                       "id"            => $id,
                       "pName"         => $_POST['pName'],
                       "pImage"     => $_POST['pImage'],
                       "pCode"         => $_POST['pCode'],
                       "price1"        => $_POST['price1'],
                       "price2"        => $_POST['price2'],
                       "price3"        => $_POST['price3'],
                       "price4"     => $_POST['price4'],
                       "quantity"    => 1
                       );
    $_SESSION['basket'][] = $product_array;

simply array is working in CI Session class. But can't add the session auto incremented array. Even i also try to do this.

Code:
$basket[] = array(
                       "id"            => '1',
                       "pName"         => "name",
                       "quantity"    => 1
                       );
                      
        $this->session->set_userdata($basket);

but not helpful.

Any idea??


Messages In This Thread
CI Session Array Problem - by El Forum - 11-02-2010, 01:41 AM
CI Session Array Problem - by El Forum - 11-02-2010, 02:54 AM
CI Session Array Problem - by El Forum - 11-02-2010, 03:05 AM
CI Session Array Problem - by El Forum - 11-02-2010, 03:16 AM
CI Session Array Problem - by El Forum - 11-02-2010, 03:33 AM
CI Session Array Problem - by El Forum - 11-02-2010, 06:01 AM



Theme © iAndrew 2016 - Forum software by © MyBB