dano2000 Posted March 1, 2010 Share Posted March 1, 2010 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/numbers. 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. Quote Link to comment https://forums.phpfreaks.com/topic/193839-mysql-create-table-on-the-fly-with-variable-in-php/ Share on other sites More sharing options...
dano2000 Posted March 1, 2010 Author Share Posted March 1, 2010 Maybe more explanation: I already have a table for the meeting. I want to create a table on the fly, when the meeting is entered by user, to have fields to hold the userid's of the participants that want to attend the meeting. Sorry if I am not explaining well. already have meeting tbl (meetingid, meetingname, maxparticipants, maxreserveparticipants, date, location ect... already have user tbl ( userid, fname, lname, email) what I want is to use the maxparticipants and maxreserveparticipant numbers to create a table that holds the userid's of the people who want to sign up. maxpart and maxres numbers may be different for each meeting based on user input. participant table (meetingid, participant1, participant2 until == maxparticipants) I want this table/s to be created when the user creates the meeting. Hope this makes sense. Quote Link to comment https://forums.phpfreaks.com/topic/193839-mysql-create-table-on-the-fly-with-variable-in-php/#findComment-1020164 Share on other sites More sharing options...
fenway Posted March 4, 2010 Share Posted March 4, 2010 Still don't see why there can't be a single pre-existing meeting table. Quote Link to comment https://forums.phpfreaks.com/topic/193839-mysql-create-table-on-the-fly-with-variable-in-php/#findComment-1021431 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.