Hi,
what is the correct way to save check box values in a mySQL database?
would it be
<input type="checkbox" name="apples" value="1" ... /> -- into apples field
<input type="checkbox" name="bananas" value="1" ... /> -- into bananas field
<input type="checkbox" name="oranges" value="1" ... /> -- into oranges field
or
<input type="checkbox" name="fruit[]" value="1" ... />
<input type="checkbox" name="fruit[]" value="2" ... />
<input type="checkbox" name="fruit[]" value="3" ... />
$fruit= implode(", ", $_POST['fruit']); --- insert string into fruit field
Is one method more preferable than others, if i am required to
1.show the checked values in an edit form and
2. be able to query the database field to return which fruit have been entered
Thanks