通过PHP将MySQL转换为XML [英] Convert MySQL to XML via PHP

查看:73
本文介绍了通过PHP将MySQL转换为XML的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的服务器上有一个MySQL数据库,我希望通过PHP以XML形式返回某个表.我已经看到了将XML转换为MySQL的各种方法,但是却没有一种容易遵循的相反方法.我应该如何去做?

I have a MySQL database on my server and I'd like a certain table to be returned via PHP as XML. I've seen various ways to get XML to MySQL, but not an easy to follow way of the opposite. How should I go about doing so?

推荐答案

只需拉出数据并将其手动形成XML文档(使用DOM或XMLWriter类),就没有内置的方法可以做到这一点.但是,如果您正在寻找预先构建的解决方案,则PHPMyAdmin可以将表转储到XML文档中.

Just pull the data out and manually form it into an XML document (using the DOM or XMLWriter classes), there's no built in way to just do it. If you're looking for a pre-built solution though, PHPMyAdmin has functionality to dump a table to an XML document.

这篇关于通过PHP将MySQL转换为XML的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆