i have a problem with update column with set data to NULL, i have a table user
with each one column is id_parent
column, user can delete parent and can add parent, so if user
have a parent
, id_parent
will set with user's parent id
, but user can delete parent's data, so if user
delete parent's data, id_parent
column, will set to NULL. so how to set data to null in database not " "
but NULL
.
here's my user
table.
user
id_user | name | address | id_parent
use this to set null column.it will work, dont forget add false on third parameter SET on active record
$this->db->set('id_parent', 'NULL', false);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With