It looks like the mysql part has been answered. I was going to suggest
using a ENUM
For the PHP part, if you are trying to keep multiple rows in your HTML
ie $customer = $mod_type you may not want to use a checkbox field
checkbox fields only pass a field if they are checked - so if you have
for customer, and the checkbox is not checked, then $mod_type
would NOT be from the first
row, it would be from the first CHECKED row.
The best solution I have found is to use a RADIO button with the value
set to the default.
this way it always gets a value. I have seen others suggest to using a
to preset this field so there is always a value --
<input type="hidden" name="mod_type_0" value="other"/>
<input type="checkbox" name="mod_type_0" value="alternative"
This way, if the checkbox is unchecked, it gets a value of "other", but
if it is
checked, it will pass a value ot "alternative".
Note - I am not sure how this would work with an array (mod_type).
PHP might treat
the hidden field as index 0, and if the checkbox is checked, it would be
>>>From: Nicholas Vettese [mailto:nvettese@stripped]
>>>Sent: Wednesday, July 26, 2006 12:04 PM
>>>I am trying to allow a user to use checkboxes for multiple
>>>selections, and I am trying to get the database to record
>>>the choices made by the user. I am using a VARCHAR(250),
>>>but I am guessing that may be wrong. Also, other than
>>>adding a "" to the end of the 'name' (e.g. <input
>>>type="checkbox" name="mod_type" value="alternative"
>>>/>Alternative<br />), what do I need to do?
>>>I hope I am asking this question correctly. If not, please
>>>feel free to flame me.