Here is the situation. I am fairly new at programming with php and mysql. What I want to to and what I am able to do are different right now.
This is what I am able to do.
I am able to add new records into the mysql db using the form data submitted and using an INSERT statement on the page that the values are passed to. If the checkbox is checked, the checkbox value is passed to the page and inserted into the correct column in the table in the database.
I am able to view the record with a checkbox being checked or not checked depending on if the value exists in the database or not. This is done by using the following code.
<?php if($checkbox_a== 'Value_a'){echo " CHECKED";}?>
$checkbox_a is the variable for the checkbox named checkbox_a (obviously) so, essentially what it is doing is checking the table for a value of a certain column and a certain record being equal to that value.
Note: Each checkbox I have on my form are different columns in my table. I am not using a relational database.
Also note: I am able to display values from the db and change them and update them all except using checkboxes and multiple select boxes. Drop downs and text boxes work great for displaying the records info and then change it if you want and then update.
OK.....
Now for what I want to do....
What I want to do is be able to display the values of checkboxes in a form that are already existent in the database and be able to update the database by unchecking or checking checkboxes. If the checkbox is checked, the value is updated into the database, if the checkbox is unchecked, the value returns null so that the column value for the checkbox would not have a value.
Sorry if this is hard to understand, but if there is anyone who knows what I am talking about and can help me out here that would be awsome!