I have a table which uses where
$crud->set_table('campaigns2');
$crud->where('email', $this->session->userdata('userid'));
This displays the table fine.
When a user wants to add another record they press "Add a new Campaign". This adds a record, but the email field is blank in phpmyadmin. btw, I have set the email field to invisible.
$crud->change_field_type('email', 'invisible');
I tried using
$crud->callback_add_field('email', function () {
return '$this->session->userdata('userid')) <input type="text" maxlength="50" value="" name="email">';
});
but it doesn't work. What am I doing wrong?