#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2009
    Posts
    5
    Rep Power
    0

    Form submission creates table


    I have a odd request, not sure how to do this.

    I have a database called customers. I need to create a form whereby the customer fills in their information and when they "submit" it creates a new table using fields from the form.

    So, to help me, form has 2 fields (more, but for purposes here).

    CompanyName: varchar
    EmployeeNumbers: varchar
    When they click submit, it creates a table called CompanyName in the customers database and it has 2 fields, CompanyName and EmployeeNumbers

    Can someone help me out with that?
  2. #2
  3. --
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Jul 2012
    Posts
    3,959
    Rep Power
    1014
    Hi,

    letting users create their own tables in the database makes no sense. It's just none of their business, and you can easily end up with a total mess of dead tables (typos, nonsense names etc.).

    So this is not a good idea. Creating tables and managing the database is your responsibility. So create a generic "company" table and insert a row for each form submission.

    Comments on this post

    • sir_drinxalot agrees

IMN logo majestic logo threadwatch logo seochat tools logo