I'm trying to create a PHP file that will export the contents of 4 tables in my MySQL database to an XM开发者_运维问答L file that will be downloaded to the workstation. The tables are orders, orders_products, orders_products_attributes and orders total.
I am able to do the export to xml via phpmyadmin for these tables, but it doesn't show me the syntax it's using to create it.
Any help would be appreciated!
Invoke the following command from a shell_exec() inside PHP. You'd need to add your login details alongside the -p option, of course.
mysqldump -p --xml databasename orders orders_products orders_products_attributes orders > dump.xml
details here.
精彩评论