CodeIgniter Forums
Using Checkboxes to Update DB - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: Using Checkboxes to Update DB (/showthread.php?tid=33618)



Using Checkboxes to Update DB - El Forum - 09-01-2010

[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.


Using Checkboxes to Update DB - El Forum - 09-02-2010

[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.....



Using Checkboxes to Update DB - El Forum - 09-02-2010

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