当前位置: 首页 > 图文教程 > 网络编程 > PHP > example2.php

PHP
用PHP实现小型站点广告管理(修正版)
BBS(php & mysql)完整版(七)
BBS(php & mysql)完整版(五)
PHP怎样调用MSSQL的存储过程
用PHP4访问Oracle815
BBS(php & mysql)完整版(六)
用PHP连接Oracle for NT 远程数据库
如何在PHP中使用Oracle数据库(2)
发挥语言的威力--融合PHP与ASP
超级简单的发送邮件程序
BBS(php & mysql)完整版(八)
如何在PHP中使用Oracle数据库(1)
人大复印资料处理程序_查询篇
人大复印资料处理程序_输入篇
如何在PHP中使用Oracle数据库(3)
人大复印资料处理程序_补充篇
如何在PHP中使用Oracle数据库(4)
如何在PHP中使用Oracle数据库(5)
如何在PHP中使用Oracle数据库(6)
社区(php&&mysql)一

PHP 中的 example2.php


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-09-13   浏览: 117 ::
收藏到网摘: n/a


example2.php
<?php
include_once("XML/sql2xml.php");
$sql2xmlclass = new xml_sql2xml("mysql://username:password@localhost/xmltest");
$xmlstring = $sql2xmlclass->getxml("select * from bands left join albums on bands.id = bandsID");
?>

输出结果
$xmlstring = '
<?xml version="1.0"?>
<root>
<result>
<row>
<id>1</id>
<name>The Blabbers</name>
<birth_year>1998</birth_year>
<birth_place>London</birth_place>
<genre>Rock'n'Roll</genre>
<row>
<id>1</id>
<bandsID>1</bandsID>
<title>BlaBla</title>
<year>1998</year>
<comment>Their first one</comment>
</row>
<row>
<id>2</id>
<bandsID>1</bandsID>
<title>More Talks</title>
<year>2000</year>
<comment>The second one</comment>
</row>
</row>
<row>
<id>2</id>
<name>Only Stupids</name>
<birth_year>1997</birth_year>
<birth_place>New York</birth_place>
<genre>Hip Hop</genre>
<row>
<id>3</id>
<bandsID>2</bandsID>
<title>All your base...</title>
<year>1999</year>
<comment>The Classic</comment>
</row>
</row>
</result>
</root>
'