日期:2014-05-17 浏览次数:20560 次
header("Content-type:text/xml;charset=utf-8");
$conn = new com("ADODB.Connection");
$connstr = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=". realpath("syec_mtv.mdb");
$conn->Open($connstr);
mysql_query("set names utf8;");
$rs = new com("ADODB.RecordSet");
$rs->Open("select * from mtv_singer",$conn,3,1);
echo '<?xml version="1.0" encoding="utf-8" ?>';
echo '<veryhdmtvsinger>';
echo '<pageinfo recordcount="2000" pagecount="48" pagesize="40" pageindex="1"/>';
echo '<mtvsingerlist>';
while(!$rs->eof){
$field_0=$rs->Fields(0);
$field_1=$rs->Fields(1);
$field_2=$rs->Fields(2);
$field_3=$rs->Fields(3);
$field_4=$rs->Fields(4);
$field_5=$rs->Fields(5);
$field_6=$rs->Fields(6);
echo "<mtv singerid='$field_0' singercid='$field_1' singer='$field_2' singersex='$field_3' singerarea='$field_4' singerimg='http://192.168.252.66/$field_5' singersid='http://192.168.253.34:103?sid=$field_6' />";
$rs->MoveNext();
}
echo '</mtvsingerlist>';
echo '</veryhdmtvsinger>';