HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Multiple values in checkbox

Just wondering if you can help.
I have a checkbox name 'fruit' that has multiple values e.g. apple, orange, grape
I'm looking to select multiple values and send this to a SQL table. Let's say I select all three fruits.
My problem is every time I send to the SQL table, it always display the number 1 in the field instead of "apple, orange, grape"

This is the PHP code I used:

echo $this->Form->Checkbox('Fruit', 'apple');
echo $this->Form->Checkbox('Fruit', 'orange');
echo $this->Form->Checkbox('Fruit', 'grape');

Any help would be appreciated.

Thank you

Best Answer


Sign In or Register to comment.