With checkboxes in HTML, you need to give them the same name if they belong in a group. PHP also has a little oddity in that you need to name them with [] if you want them to appear as an array in your script, which you've got in your second example. This makes it a lot easier to work with, as you can loop over the array rather than lots of arbitrarily named variables:
foreach($_POST['fruit'] as $fruit)
{
// do something with each $fruit here
}
A second point, I'd avoid putting the fruits into your DB as a comma delimited string. It's a bit messy to deal with later. For example, say Fred had the following fruits:
Banana
Apple
Orange
Pear
Pineapple
If you store it in a single string, it will look like this:
"banana,apple,orange,pear,pineapple"
Now, how would you go about removing 'apple' from the list? It's not just a case of removing a single entry in a DB, you have to rebuild the entire string. Also, what happens if you need to search for anyone who likes 'apples'? If you just search for that word, you pick up pineapple too by mistake.
It would be a lot better to have a separate table for your fruits, one for people, and a third for the connections between people and fruits, for example:
People Table:
user_id, name
1, Fred
2, Tom
3, Dick
4, Harry
Fruits Table:
fruit_id, fruit
1, Apple
2, Banana
3, Pear
4, Strawberry
5, Orange
6, Pineapple
People_fruits Table:
user_id, fruit_id
1, 1
1, 2
1, 4
2, 2
2, 3
2, 4
3, 6
3, 1
3, 2
4, 1
4, 6
It might look complex at first, but it's incredibly more powerful and easy to use.