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
https://forums.phpfreaks.com/topic/121291-posting-multiple-text-area/
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).

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.

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...

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.