I’m doing an insert to a table, some data is empty so I expect some fields to get the default value I assigned.
$data = array(
'id' => $id,
'user' => $this->input->post('name'),
);
$this->the_model->the_model_funciton($data);
The problem is with the user field, the default value for the field is ‘Anon’ but when there’s no data in the post(‘name’) an empty value is inserted instead of the default value in the field.
User field is varchar, null.
Would this do it?