Well, listing all the values in a comma separated list in the DB would be fairly simple to parse, check out:
http://www.php.net/manual/en/function.explode.php

As far as what is better depends on many things...
1). Maintaining the code, might be better to have each check box have its own field, will certainly cut down on development/debugging. 2). Performance...don't know if it is faster for PHP to parse through a comma separated list or parse through a larger DB record set. I guess if this is really important to you, you might want to attempt both ways to see on performance.

-Brad



Rahul S. Johari wrote:

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: [EMAIL PROTECTED]
http://www.informed-sources.com



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to