Welcome Guest, Not a member yet? Register   Sign In
store array into session.
#1

[eluser]PHPraja[/eluser]
Code:
Array
(
    [0] => Array
        (
            [MyStuffId] => 513
            [PlaceId] => 189
            [PlaceName] => TEST1234
            [PlaceStatus] => present
            [ScopeId] => 1
            [FavouriteFlag] => 1
            [ExpiryDate] => 0000-00-00 00:00:00
            [placeaddressType] => P
            [Latitude] =>
            [Longitude] =>
        )

    [1] => Array
        (
            [MyStuffId] => 473
            [PlaceId] => 41
            [PlaceName] => place placepal
            [PlaceStatus] => present
            [ScopeId] => 3
            [FavouriteFlag] => 1
            [ExpiryDate] => 0000-00-00 00:00:00
            [placeaddressType] => P
            [Latitude] =>
            [Longitude] =>
        )
)

how can is add the above array data to a session variable? Is it possible to store two dimensional array in a session variable? Can any one help me plz.
#2

[eluser]Vince Stross[/eluser]
Code:
$my_data = array(0=>array(...),1=>array(...),2=>array(...));
$this->session->set_userdata('my_data',$my_data);

To play with your data you have to pull it into a variable:

Code:
$my_data = $this->session->userdata('my_data');
// Now $my_data is a 2D array




Theme © iAndrew 2016 - Forum software by © MyBB