Jump to content

Posting Multiple text area


tapupartforpres

Recommended Posts

Hello people.  I search and could not find a solution.  Wondering if someone could help.

 

Basically I am creating a form that people can fill to register for an event. They have the option to add a number of guests.  Here is my question:

 

1.  In the form if they have guests, how does one post that data to the SQL database so that I know who's guest goes with the main person who filled out the form?

Link to comment
Share on other sites

Either you keep track of guests in a by giving your table a `guest_of` or `parent` field (whichever is more semantically pleasing for you),

 

or

 

if you only want the guests to exist for each person just add a guests field with comma separated names of the guests (guest1,guest2,guest3).

Link to comment
Share on other sites

Either you keep track of guests in a by giving your table a `guest_of` or `parent` field (whichever is more semantically pleasing for you),

 

or

 

if you only want the guests to exist for each person just add a guests field with comma separated names of the guests (guest1,guest2,guest3).

 

No no no, please don't do the CSV.  Just make another table and do a join to get the guests for each person.

Link to comment
Share on other sites

You can use the same table and do a join to the same table.

 

lets say `id`, `parent`, `name`

 

SELECT t1.name as guest_name,t2.name as parent_name FROM table as t1 LEFT JOIN table as t2 ON t1.parent = t2.id WHERE t1.id = 'guests_id'

 

sorry I can't follow up I'm off good luck...

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.