Welcome Guest, Not a member yet? Register   Sign In
How to edit particular value in session table?
#1

[eluser]peekk[/eluser]
Hello,
when I type
Code:
print_r($this->session->all_userdata());
it shows

Code:
[user_data] => [search_conditions] => Array ( [aaa] => value1, [bbb] => value2 ) )


I want to change only the value of 'aaa' index in search_conditions table (example: 'value1' into 'changed_value1' - how to do it?
#2

[eluser]CroNiX[/eluser]
Code:
//Get the key 'search_conditions' data from session
$data = $this->session->userdata('search_conditions');

//Overwrite the value for 'aaa' (should currently be Array ( [aaa] => value1, [bbb] => value2 ))
$data['aaa'] = 'changed_value1';

//store it back in session using 'search_conditions' as the key
$this->session->set_userdata('search_conditions', $data);




Theme © iAndrew 2016 - Forum software by © MyBB