php生成XML求助
大家来看看,我到底是哪里写错了
<?
require_once("conn.php");
echo "<?xml version='1.0' encoding='utf-8'?>";
echo "<menuitems>";
$result = mysql_db_query("myly","select * from myTable");
while($row = mysql_fetch_object($result)) {
echo "<item><species>".$row->name."</species>";
echo "<location><![CDATA[".$row->location."]]></location></item>";
}
echo "</menuitems>";
mysql_free_result($result);
mysql_close();
?>
预览地址www.fkdiy.cn/cs/getXML.php