Hello, i have a database in SQL and a Table, how can i auto create a table according the value of a record on the first table. For a exable let say that a user is sign up, then a text filed called referal (For exable) shows a row in the first table that have an initial value if the user does not put anything in that text filed, but if the user ender data in that field then a table is created with name equals with the ender data. (the endered data is usual represends a record on the first table. How can i do that?? should a variable work? (Sorry for my english).
First and foremost--you shouldn't do this. It reeks of an unnormalized database and will most definetly give you fits on down the line. With that out of the way, here's how you would generally accomplish this: You would do this programmatically. First you would retrieve the value(s) from that initial table with a SELECT query, putting them into a variable, then you would use a programming language to create and execute a CREATE TABLE query in SQL using the necessary information you retrieved from the SELECT query. And remember--don't do this.
So you say that the database will Crash??? What you suggesting for Programming language?? You think that PHP should Work? Thanks.
The database won't crash, its just not the right way to set up a database. Google: 'database normalization'. I'm not suggesting a programming language, whichever one you are most comfortable with should work as long as it can interact with your database. PHP would work.