working on data from a multi-select form field
| From: | Ed Lazor | Date: | Mon, 24 Jul 2000 11:00:44 +0000 |
| Subject: | working on data from a multi-select form field | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-7852@lists.php.net to get a copy of this message | ||
I'm trying to figure something out and thought to check with you to see if you had any ideas - no use recreating the wheel hehe I have a form that collects information and several of the fields are select fields with the ability to choose multiple items.
Thanks to the mailing list archive, I just learned about creating form variable arrays and how to get a list of which items the end-user chose. Now I'm puzzled and can't seem to find any recommendations on what to do with the data. I'm used to storing standard forms into the database, but what do you do when one of the fields is an array? Do I end up creating another table in the database and cross-link the two? Something like this?
table one (person)
------------------
id
name
age
address
fav_books
table two (books)
-----------------------
id
title
And... then when you go to store the data from the form, you end up having to manually seperate and store everything? Or, is there an easier approach? This one seems like it'll work, but seem really cumbersom.
Thanks =)
-Ed