如何把 mysql 中的数据生成一个 xml文档 用SQLYOG。里面有一个导入数据到XML 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <?php$hostname_conn = "localhost";$database_conn = "image_gallery";$username_conn = "root";$password_conn = "fuckme";$conn = mysql_pconnect($hostname_conn, $username_conn, $password_conn) or trigger_error(mysql_error(),E_USER_ERROR); ?><?php// Query the database and get all the records from the Images table mysql_select_db($database_conn, $conn);mysql_query("SET NAMES 'GBK'");$query_rsImages = "SELECT ID, AlbumName, ImagePath, ImageDescription, UploadDate FROM images";$rsImages = mysql_query($query_rsImages, $conn) or die(mysql_error());$row_rsImages = mysql_fetch_assoc($rsImages);$totalRows_rsImages = mysql_num_rows($rsImages);// Send the headersheader('Content-type: text/xml;charset=GBK');header('Pragma: public'); header('Cache-control: private');header('Expires: -1');?><?php echo('<?xml version="1.0" encoding="GBK"?>'); ?><images> <?php if ($totalRows_rsImages > 0) { // Show if recordset not empty ?> <?php do { ?> <image> <ID><?php echo $row_rsImages['ID']; ?></ID> <album><![CDATA[<?php echo $row_rsImages['AlbumName']; ?>]]></album> <path><![CDATA[<?php echo $row_rsImages['ImagePath']; ?>]]></path> <description><![CDATA[<?php echo $row_rsImages['ImageDescription']; ?>]]></description> <date><![CDATA[<?php echo $row_rsImages['UploadDate']; ?>]]></date> </image> <?php } while ($row_rsImages = mysql_fetch_assoc($rsImages)); ?> <?php } // Show if recordset not empty ?></images><?phpmysql_free_result($rsImages);?> PHP语句问题 求个正则表达式 请问jquery如何删除当前列? 【看看啦】怎么做才能让特定的页面只能被本机调用.... 菜鸟问题:简单函数转换(asp转php) 邮件发不出去 能不能用mail()函数以附件的形式发送邮件? 如何对phpnuke等新闻文章管理软件迅速上手 一个另我头痛的问题???高分求教!!! 一个简单的PHP问题 列车时间差问题 GetRows()问题。。。。。
$hostname_conn = "localhost";
$database_conn = "image_gallery";
$username_conn = "root";
$password_conn = "fuckme";
$conn = mysql_pconnect($hostname_conn, $username_conn, $password_conn) or trigger_error(mysql_error(),E_USER_ERROR);
?>
<?php
// Query the database and get all the records from the Images table
mysql_select_db($database_conn, $conn);
mysql_query("SET NAMES 'GBK'");
$query_rsImages = "SELECT ID, AlbumName, ImagePath, ImageDescription, UploadDate FROM images";
$rsImages = mysql_query($query_rsImages, $conn) or die(mysql_error());
$row_rsImages = mysql_fetch_assoc($rsImages);
$totalRows_rsImages = mysql_num_rows($rsImages);// Send the headers
header('Content-type: text/xml;charset=GBK');
header('Pragma: public');
header('Cache-control: private');
header('Expires: -1');
?>
<?php
echo('<?xml version="1.0" encoding="GBK"?>');
?>
<images>
<?php if ($totalRows_rsImages > 0) { // Show if recordset not empty ?>
<?php do { ?>
<image>
<ID><?php echo $row_rsImages['ID']; ?></ID>
<album><![CDATA[<?php echo $row_rsImages['AlbumName']; ?>]]></album>
<path><![CDATA[<?php echo $row_rsImages['ImagePath']; ?>]]></path>
<description><![CDATA[<?php echo $row_rsImages['ImageDescription']; ?>]]></description>
<date><![CDATA[<?php echo $row_rsImages['UploadDate']; ?>]]></date>
</image>
<?php } while ($row_rsImages = mysql_fetch_assoc($rsImages)); ?>
<?php } // Show if recordset not empty ?>
</images>
<?php
mysql_free_result($rsImages);
?>