dongzhouji4021 2011-12-12 13:42
浏览 11
已采纳

从php中的3个表创建xml

I have 3 Tables, 2 Tables from 1 Database and 1 Table from other Database.

Database "GER":
Tables:
1. account
fields:
- accountid
- accountname
2. accountbillads
fields:
- accountaddressid
- bill_city
- bill_street

Database "STG":
Table:
1. edata
fields:
- deviceid
- lat
- long

Field "accountid" and "accountaddressid" have the same data.
Field "accountname" and "deviceid" have the same data.

How i may to create XML file with this structure in PHP ?

  <?xml version="1.0" encoding="utf-8"?>
<markers>
<marker accountid="13" accountname="alex" bill_city="london" bill_street="knighton 13" lat="23.456" long="13.456"/>
</markers>

any reference will help me. thanks

  • 写回答

1条回答 默认 最新

  • dqy006150 2011-12-12 14:03
    关注

    first of all your must have access to both databases. If you haven't done already, take a look at the GRANT syntax in mysql manual.

    After setting correct permissions, you execute your normal queries, using db/tablenames.

    For example: SELECT ger.account.accountid FROM ger.account WHERE ...

    Grant syntax: http://dev.mysql.com/doc/refman/5.1/en/grant.html

    Select syntax: http://dev.mysql.com/doc/refman/5.0/en/select.html

    After that, you use php to retrieve data as you want them from both databses to create your xml document

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

报告相同问题?

悬赏问题

  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度