This question is similar to Copy table structure into new table
I want to write a php script that that makes a copy of a table including all constraints etc and puts that table onto a different server. What's the best way to do this?
I was thinking something like:
create table moo (like old_moo including defaults including constraints including indexes)
But as far as I know this doesn't copy foreign keys or triggers. Also I dont know if it's possible to get that command to work between different servers (so far I haven't been able to find out how...).
Any clues?