hi,
I need to modify my table structure inside a MySQL db using just a PHP connection. How do I do that? mysql_query only allows SELECT, UPDATE, REPLACE etc., i.e. only changing the data rather than the table structure.
thanks for your help.
Try this:
$sql=MySQL_Query("ALTER TABLE some_table ADD(some_column varchar(5))");
You can use: ADD or REMOVE
mysql_query allows ALL sql statements, including ALTER TABLE.
Sorry this is correct:
$sql=MySQL_Query("ALTER TABLE some_table ADD some_column varchar(5)");
and
$sql=MySQL_Query("ALTER TABLE some_table DROP some_column");
You can use ADD or DROP function