One the websites I am working uses a lot of checkboxes. 60 to be infact, so naturally I created a Table with 60 fields to begin with
The other night I was thinking, like you do that there is no need to have 60 fields, I could just combine all the results in to one.
When a checkbox is checked 1 is inserted
When a checkbox is unchecked 0 is inserted
When the form is posted all the 1 and 0's could be combined in to one string and then inserted in to one field like so 111100001010110001111100011
Then I could pull the results from the database and then pick off each number individually using the following code
// Split the string//
$checkbox_answers_temp = $row['checkbox_answers'];
$checkbox = explode(" ", $checkbox_answers_temp);
echo $checkbox[0];
echo $checkbox[1]; and so on.....
This would not only save a lot of Dbase space but it is easier to admin as well.
Then I came across my problem how would I able to search. If I had sixty fields this would be a peice of cake.
Any Ideas?