trying to update the session data in the session table for all session ids but been struggling for few hours.
$_data = array('sess_data' => 'abc');
$this->db->where('sess_id', $_sid);
$this->db->update($_table, $_data);
The code below give me a value of 1 which indicates the above code does works.
$this->db->affected_rows();
but when i view the database through phpmyadmin, nothing is updated. There are no mysql error messages generated. pls advise how to proceed further.
Edited
UPDATE `sessions` SET `sess_data` = 'abc' WHERE `sess_id` = 'skavnhgk84712r06npem76snu2'
Updated:
Strange, today I add 2 more session records and it only updates the 2nd & 3rd records, the 1st record does not change. Why is it so? I'm using foreach loop and below are the generated query.
UPDATE `sessions` SET `sess_data` = 'ABC' WHERE `sess_id` = 'skavnhgk84712r06npem76snu2' no success!
UPDATE `sessions` SET `sess_data` = 'ABC' WHERE `sess_id` = 'skavnhgk84712r06npem76snu3' success
UPDATE `sessions` SET `sess_data` = 'ABC' WHERE `sess_id` = 'skavnhgk84712r06npem76snu4' success
$this->db->last_query()to view the query generated. - Nil'z