dshmvqnl98119 2011-08-26 16:50
浏览 49
已采纳

将数据从一个用户安装导出到另一个用户安装

I want to give users the functionality of export data from one WordPress plugin installation from one site to another. A "WordPress plugin" doesn't make the difference, I'm interesting in the recommended approach to export/import data in a PHP application that has the data stored in a MySql database. The data is related to each other in database.

I'm interesting in:

  • Which is the recommended format to store the data in the exported file (JSON, Xml, serialized)? Taking in care that the data is related to each other by fields in each of the MySql table, and that can be very big.

Example:

Student table has: ID, Name and Class_ID...

Class table has: ID, Description...

  • Which is the recommendations to avoid specific users problems with hosting configurations that could affect the exporting or importing of large amount of data?

Example: the execution time, the max files size, the max allowed database queries


Important take in care that destination system could have already data that have the same values in the fields declared as keys, for example:

I export the Class with

ID = 5, and Description = "This is cool class"

and in the destination database could be already the Class with:

ID = 5, and Description = "This is other old class"

Where ID is the primary key in "Class" table.


Any idea around this will be appreciated. If some other information is required let me know.

Thanks in advanced.

  • 写回答

1条回答 默认 最新

  • douan7529 2011-08-26 17:12
    关注

    I would suggest you write your data into XML. It means you have to construct the XML on export, and then you have to read the XML file on input. This way, you control the format and you can change how you handle the import between versions of your plugin.

    I can add a bit more detail on how to do this, if you need, but it looked like you were just looking for information on the general approaches.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥35 平滑拟合曲线该如何生成
  • ¥100 c语言,请帮蒟蒻写一个题的范例作参考
  • ¥15 名为“Product”的列已属于此 DataTable
  • ¥15 安卓adb backup备份应用数据失败
  • ¥15 eclipse运行项目时遇到的问题
  • ¥15 关于#c##的问题:最近需要用CAT工具Trados进行一些开发
  • ¥15 南大pa1 小游戏没有界面,并且报了如下错误,尝试过换显卡驱动,但是好像不行
  • ¥15 自己瞎改改,结果现在又运行不了了
  • ¥15 链式存储应该如何解决
  • ¥15 没有证书,nginx怎么反向代理到只能接受https的公网网站