Well is depends on how your database has been set up. What I did with checkbox database was set up enum datafields for each of the possible values that could be entered via a form. Some thing like
cola ENUM("yes","no"),
beer ENUM("yes","no),
milk ENUM("yes","no"),
coffee ENUM("yes","no),
tea ENUM("yes","no")
...
Then my checkbox values would be written as an associative array with the name 'drinks' like below
<input type='checkbox' name='drinks['beer']' value='beer' />Beer<br />
<input type='checkbox' name='drinks['milk']' value='milk' />Milk<br />
<input type='checkbox' name='drinks['coffee']' value='coffee' />Coffee<br />
<input type='checkbox' name='drinks['tea']' value='tea' />Tea<br />
Now that you have a database structure for the drinks and a form to input the data with you just need to check those values after they are posted like so
$beer =($_POST['drink'][beer]== 'beer'? 'yes': 'no');
$milk =($_POST['drink'][milk]== 'milk'? 'yes': 'no');
$coffee = ($_POST['drink'][coffee]== 'coffee'? 'yes': 'no');
$tea = ($_POST['drink'][tea]== 'tea'? 'yes': 'no');
Now depending on whether the box was checked or not will determine the vallue assigned to all those short varaibles, either yes or no for each then just insert them into your database. To retrieve the values if the values in the database are yes then you would just echo
<input type='checkbox' name='drinks['beer']' value='beer' checked />
That should get you started.