Hi i am trying to create a table using a script. I am new to mysql so i'm not familar with all of the syntax.
Can someone help me with my code. I want to create a table name with space using a script. I can do this using phpmyadmin but i have a lot of tables to create and i would like to use a script.
here's a copy of my code:
PHP Code:
<?
include("dbinfo.php");
mysql_connect(mysql,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$tablename = "ECON 1 (Scott) HW";
$query= "CREATE TABLE $tablename (time datetime NOT NULL default '0000-00-00 00:00:00', first_name varchar(30) NOT NULL, last_name varchar(30) NOT NULL, email varchar(50) NOT NULL, PRIMARY KEY (time)
)";
mysql_query($query);
mysql_close();
echo "Database created";
?>
any suggestions?