开发者

Export/Import mySQL query with PHP

I'm looking to implement an Export/Import feature in a WordPress Plug-in. The only scenario that I can think of, is exporting the data after querying the database to some format and then re-reading it (for import) and creating a query with that data.

I'm thinking if there is a shortcut for that. What I want basically is a function to get the SQL query of the data I have in the database and then execute it w开发者_JAVA技巧hen importing. This is basically the same function in PHPmyAdmin that exports the database.

Anyone have an idea?


Check out MySQL's SELECT Syntax, specifically the ... INTO OUTFILE portion. Couple that with MySQL's LOAD DATA INFILE Syntax and you might be in business.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜