Jump to content

[SOLVED] create table question


sser

Recommended Posts

Hi everybody,

How can I create a table where the name is a variable specified before?

 

The code snippet is..:

 

  $test_table = basename($array[$i], ".dat");

  #mysql_query($test_table);

echo $test_table;

 

 

$query = "CREATE TABLE '$test_table' (field1 INT, field2 CHAR(20) NOT NULL, field3 CHAR(50) NOT NULL)";

 

where $test_table is supposed to be the filename.

 

When I try running this code, the table is named as $test_table.

 

Thanks...

Link to comment
https://forums.phpfreaks.com/topic/80349-solved-create-table-question/
Share on other sites

Archived

This topic is now archived and is 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.