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

PHP
在php中使用sockets:从新闻组中获取文章
用Zend Encode编写开发PHP程序
通过对服务器端特性的配置加强php的安全
Windows下PHP的任意文件执行漏洞
网站加速 PHP 缓冲的免费实现方法
最小化数据传输——在客户端存储数据
类的另类用法--数据的封装
GD输出汉字的函数的分析
自己动手做一个SQL解释器
php中文本数据翻页(留言本翻页)
web方式ftp
一个显示天气预报的程序
一个查看session内容的函数
如何把PHP转成EXE文件
提取HTML标签
输出控制类
搜索引擎技术核心揭密
通过ICQ网关发送手机短信的PHP源程序
一个ORACLE分页程序,挺实用的.
PHP中GET变量的使用

PHP 中的 example2.php


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-09-13   浏览: 93 ::
收藏到网摘: 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>
'