[eluser]PHP Creative[/eluser]
Hi there
I have the following code. It updates the session data with the an array from the table.
Code:
$this->db->select('ID');
$this->db->from('FoodTable');
$this->db->where('Food',$this->input->post('food'));
$query = $this->db->get();
$data = array(
'FoodID' => $query->result_array()
);
$this->session->set_userdata($data);
What I want to do is keep the old values and add the new ones to the session data. For example a user comes along, searches for something, adds to the session, then searches for another thing. Both searches are included in session so I can display in a table.
The above code only keeps the new session and not the old data as it is overwritten.
Any help or advice would be much appreciated.
Thanks a millon