CodeIgniter Forums

Full Version: Using Checkboxes to Update DB
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]Bionicjoe[/eluser]
I have a bit field column in my table called 'is_resolved' for marking the status of an issue. 0 for no/FALSE and 1 for yes/TRUE.
Users can simply check the box to resolve the issue.

I'm struggling getting the user's check (or uncheck) to enter a 1 or 0.
No problems with the DB or anything, just need a little howto.

This is partial code for submitting info to the DB.
Code:
$data = $this->data = array(
          'is_resolved' => $this->input->post('is_resolved'),
        'ticketnumber' => $this->input->post('ticketnumber', TRUE),
Right now regardless of whether the box is checked/unchecked the field gets changed to 0.

El Forum

[eluser]Bionicjoe[/eluser]
When posting my is_resolved field is just blank & I cannot figure out how to get anything to populate.
Code:
Array ( [is_resolved] => [ticketnumber] => INC000000000001.....

El Forum

[eluser]Clooner[/eluser]
Enable the profiler to see if the data gets posted!