简体   繁体   English

从数据库提取到XML

[英]Extract from DB to XML

I have made a website where users can choose some regions on Google Maps, and save them into a database with a name an a description. 我已经建立了一个网站,用户可以在其中选择Google Maps上的某些区域,并将其保存到名称为description的数据库中。 What I need now is to be able to take the saved entries from my DB and show them also to an android app I have made with google maps. 我现在需要的是能够从数据库中获取保存的条目,并将它们也显示给我使用Google Maps制作的Android应用。 I am new to all these and from my research I understand that I should extract my data from the DB to an XML file and then parse them on the phone. 我对所有这些都是新手,从研究中我了解到,我应该将数据库中的数据提取到XML文件中,然后在电话上进行解析。 For doing the first part I should use the following code, if I am not mistaken: 如果我没有记错的话,那么我应该使用以下代码来做第一部分:

SELECT column1, column2,..
FROM tablename
FOR XML PATH;

What I still dont get is where should I put that piece of code? 我仍然不明白的是,我应该将该代码放在哪里? In a new file? 在一个新文件中? All by itself? 全部靠自己? And with that code the XML file will be created, or should I do something else too? 并使用该代码创建XML文件,还是我应该做其他事情? Thank you 谢谢

Well since noone answered my question and I did find the solution I'll post it here. 好吧,因为没有人回答我的问题,而且我确实找到了解决方案,所以我将其发布在这里。 The answer is via PHP, XMLWriter. 答案是通过PHP,XMLWriter。 There is a question here that helped but I wasnt able to find from the beginning since I didnt know what to search for. 有一个问题在这里 ,帮助,但我不是能够从一开始找,因为我不知道该怎么寻找。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM