MySQL Tables
Moderator: General Moderators
MySQL Tables
How to I create MySQL tables trough PHP. I am looking for a command here, not a way of running a text file with the information. That I know how to. I was looking for a PHP command to do this.
Code: Select all
mysql_create_table('tablename');- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
Unfortunately, mysql_create_table() doesn't exist (mysql_create_db() does although it is deprecated) instead you need to run an SQL statement containing the information required to create a table. Once you're connected to the database you could do something like:
Basically you would just use the SQL CREATE TABLE statement.
Mac
Code: Select all
$sql = "CREATE TABLE test (blob_col BLOB, INDEX(blob_col(10)))";
mysql_query($sql) or die(mysql_error());Mac