php - How to update table with column set NULL in codeigniter -


i have problem update column set data null, have table user each 1 column id_parent column, user can delete parent , can add parent, if user have parent, id_parent set user's parent id , user can delete parent's data, if user delete parent's data, id_parent column, set null. how set data null in database not " " null. here's user table.

user  id_user | name | address | id_parent 

use set null column.it work, dont forget add false on third parameter set on active record

$this->db->set('id_parent', 'null', false); 

Comments