How to copy tables from one database to another?
Moderator: General Moderators
How to copy tables from one database to another?
Hello! I have a problem: i need to make a php function: function copy_tables($database,$tables) which allows you to copy the $tables from a certain database to the $database passed as parameter.My problem is that i don't know how to copy the tables and the table structure from one database to another.I don't need to copy the data in the tables,just the tables and the table structure (field names).Can you help me with this? If it's not clear what i want,please say and i'll try to explain it again.I really need your help! Thanks!
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
here's a push in the right direction:http://dev.mysql.com/doc/mysql/en/show- ... table.html
Code: Select all
SHOW CREATE TABLE `tableName`- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
Code: Select all
DESCRIPT `tableName`