2006/5/17, Rahul S. Johari <rjohari@xxxxxxxxxxxx>:
Ave, I¹m a little confused as to what¹s the best way to handle this. I have a form which, apart from lots of other fields, has a set of 25 30 Check Boxes, each of which asks the user for some kind of information which the user can check or leave unchecked. The information each Check Box collects will also appear in the ³Listing² for users to view once the user has completed & submitted the form. Furthermore, there is an Advanced Search also available to users which will also provide the same 25 - 30 check boxes which define the search criteria. I¹m not sure what¹s the best, most efficient way to do this. The tedious way to do this is to make 30 fields in the mySQL database, and if the check box is checked, the data goes into the corresponding field... And similarly listing the data from the field if field is non-empty.... And similarly including each field in the Search options. I want suggestions for a better/faster way to do this. I did think about creating a single field and storing the data from each Œchecked¹ check box as comma separated values in the single field. I¹m not sure how to do that and if that¹s the best way.... But even if I can, I¹m not sure how to get the data to display separately out of that field in the Listings view and more importantly how to include that data in the Search options. Any help would be appreciated. Thanks, Rahul S. Johari Coordinator, Internet & Administration Informed Marketing Services Inc. 500 Federal Street, Suite 201 Troy NY 12180 Tel: (518) 687-6700 x154 Fax: (518) 687-6799 Email: rahul@xxxxxxxxxxxxxxxxxxxx http://www.informed-sources.com
You should consider using MySQL special column type SET: http://dev.mysql.com/doc/refman/5.1/en/set.html Or encoding each checkbox status as a binary bit in an integer (which is what MySQL does when using a SET column).