example2.php
更新時(shí)間:2006年10月09日 00:00:00 作者:
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");
?>
輸出結(jié)果
$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>
'
相關(guān)文章
《PHP邊學(xué)邊教》(02.Apache+PHP環(huán)境配置——下篇)
《PHP邊學(xué)邊教》(02.Apache+PHP環(huán)境配置——下篇)...2006-12-12
關(guān)于PHP中的Class的幾點(diǎn)個(gè)人看法
關(guān)于PHP中的Class的幾點(diǎn)個(gè)人看法...2006-10-10
PHP PDOStatement::bindColumn講解
今天小編就為大家分享一篇關(guān)于PHP PDOStatement::bindColumn講解,小編覺(jué)得內(nèi)容挺不錯(cuò)的,現(xiàn)在分享給大家,具有很好的參考價(jià)值,需要的朋友一起跟隨小編來(lái)看看吧2019-01-01
用PHP來(lái)寫(xiě)記數(shù)器(詳細(xì)介紹)
利用一個(gè)文本文件實(shí)現(xiàn)多個(gè)頁(yè)的計(jì)數(shù)減少服務(wù)器的I/O占用率在需要紀(jì)錄的文件里,只需加入很少的幾行代碼2006-10-10
Win2000+Apache+MySql+PHP4+PERL安裝使用小結(jié)
Win2000+Apache+MySql+PHP4+PERL安裝使用小結(jié)...2006-10-10
在PHP3中實(shí)現(xiàn)SESSION的功能(一)
在PHP3中實(shí)現(xiàn)SESSION的功能(一)...2006-10-10

