Entry
How can I create a table into a MySql database thru PHP?
Mar 21st, 2000 19:16
Ben Munoz, Preston Granbery, Nagesh Kumar,
The PHP function "mysql_query" can be used for more than just UPDATEs,
INSERTs, DELETEs and SELECTs. In particular:
mysql_query("CREATE TABLE table_name (create_definition, . . . )");
...should work.
Note: You should, however, double check that the user connecting to the
database (in your mysql_connect code) has permissions to create
tables. It normally will, but if not, look into the "GRANT" syntax in
the MySQL online manual.