When I try to tell MySQL to create two tables in a single query from php nothing shows up in the DB:
If I split it into two queries it works fine:Code:$query = 'CREATE TABLE table1( cid INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(cid)); CREATE TABLE table2( cid INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(cid))'; mysql_query($query);
Is there something wrong with my syntax? It works fine when I submit the query in phpmyadmin.Code:$query = 'CREATE TABLE table1( cid INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(cid))'; mysql_query($query); $query = 'CREATE TABLE table2( cid INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(cid))'; mysql_query($query);



Reply With Quote


Bookmarks