I'm having a problem with this:
What's wrong with this code?PHP Code:$db = mysql_connect("localhost", "user", "password");
mysql_select_db("database",$db);
$sql = "INSERT INTO cats (name,tablename) VALUES ('$name','$tablename')";
$sql2 = "CREATE TABLE $tablename (id tinyint(4) DEFAULT '0' NOT NULL AUTO_INCREMENT, name varchar(20), desc text, code text, PRIMARY KEY (id), UNIQUE id (id))";
$result = mysql_query($sql);
$result2 = mysql_query($sql2);
The INSERT INTO works, but the CREATE TABLE never creates the table??![]()




Reply With Quote