Jump to content

Creating Tables - tricky


peuge

Recommended Posts

I have called in an array of field names entered in a from from a form in the previous php page. with these names I want to create a table with these fields in the database which has already been selected. The thing is these names could be different for each time I create a new table so I need to use these names from the array. Can I do this in the CREATE TABLE?

 

$name_array = $_POST['fieldname'];

$tname = $_POST['tname'];

 

 

mysql_query("CREATE TABLE $tname(

id INT NOT NULL AUTO_INCREMENT,

PRIMARY KEY(id),

//WHAT DO I PUT HERE?

 

Thanks  :)

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.