m3atwad Posted January 8, 2007 Share Posted January 8, 2007 I am trying to create a bunch of tables (50) and i am using a loop to do so. The problem is they all have diff. names so i got to use a variable as the name so i can keep changing the variable every time the loop executes.$query = 'CREATE TABLE $state( id INT AUTO_INCREMENT, profile_name VARCHAR(50), real_name VARCHAR(40), personal_description TEXT, email VARCHAR(40), state VARCHAR(25), personal_website VARCHAR(50), type_of_work VARCHAR(30), sex VARCHAR(10), age INT, experience VARCHAR(40) pic_availability VARCHAR(10), height_feet INT, height_inches INT, weight INT, hair_color VARCHAR(30), bust_inches INT, bust_cup VARCHAR(10), ethnicity VARCHAR(20), eye_color VARCHAR(10), pic1 VARCHAR(40), pic2 VARCHAR(40), pic3 VARCHAR(40), pic4 VARCHAR(40), pic5 VARCHAR(40), pic6 VARCHAR(40), pic7 VARCHAR(40), pic8 VARCHAR(40), pic9 VARCHAR(40), pic10 VARCHAR(40), key VARCHAR(40),)';the query looks like that where $state is the name of the table (50 states) and every iteration it changes. Can this be done this way? Link to comment https://forums.phpfreaks.com/topic/33359-table-creation-loop-problem/ Share on other sites More sharing options...
Jessica Posted January 8, 2007 Share Posted January 8, 2007 Did you try it?BTW: bust cup? wtf? another dating site based on looks? Woohoo! Link to comment https://forums.phpfreaks.com/topic/33359-table-creation-loop-problem/#findComment-155868 Share on other sites More sharing options...
m3atwad Posted January 8, 2007 Author Share Posted January 8, 2007 haha .... no it is going to be a tool for the modeling industry. No i havn't tried it yet, just wonderd if anyone has done this before. gonna try it when i get home tonight. Link to comment https://forums.phpfreaks.com/topic/33359-table-creation-loop-problem/#findComment-155890 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.