Create a mysql table on the fly with supplied variable/s?
Posted: Mon Mar 01, 2010 5:17 pm
Noob here... Flames, jabs, I know I got it all coming....
I have a php/myspl db. Trying to store a meeting registration db...
I got a table for meeting and table for users.
When the user creates a new meeting they supply seats available($seats) and reserve seats available($resseats) lets say.
So where do I start when I want to create the table on the fly to store seats based off of the $seats and $resseats variables.
I know, I will have to loop to create the field names for the table on the fly.
Can I loop within a CREATE TABLE statement? Not sure what that would look like.
Or do I need to create and set of field names first, then shove them into the CREATE TABLE?
Sorta brain fried and brain blocked here.
Just kinda need a push in the right direction.
I understand the basics of php and mysql and have php putting and getting info from mysql db.
I admit though this is a little above my head.
Thanks for any info.
I have a php/myspl db. Trying to store a meeting registration db...
I got a table for meeting and table for users.
When the user creates a new meeting they supply seats available($seats) and reserve seats available($resseats) lets say.
So where do I start when I want to create the table on the fly to store seats based off of the $seats and $resseats variables.
I know, I will have to loop to create the field names for the table on the fly.
Can I loop within a CREATE TABLE statement? Not sure what that would look like.
Or do I need to create and set of field names first, then shove them into the CREATE TABLE?
Sorta brain fried and brain blocked here.
Just kinda need a push in the right direction.
I understand the basics of php and mysql and have php putting and getting info from mysql db.
I admit though this is a little above my head.
Thanks for any info.