|
 |
|
เปลี่ยนชื่อตัวแปร โดยใช้ลูป for ครับ ตัวแปรเป็น xml นะครับ ช่วยหน่อยครับ |
|
 |
|
|
 |
 |
|
Code (PHP)
<?php
header("Content-type:text/xml; charset=UTF-8");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
echo '<?xml version="1.0" encoding="utf-8"?>';
$objConnect = mysql_connect("localhost","root","root");
$objDB = mysql_select_db("mydatabase");
$strSQL = "SELECT * FROM images WHERE 1 ";
$objQuery = mysql_query($strSQL);
?>
<images>
<?
while($obResult = mysql_fetch_array($objQuery))
{
?>
<item>
<ImageID><?=$obResult["ImageID"];?></ImageID>
<ItemID><?=$obResult["ItemID"];?></ItemID>
<ImagePath><?=$obResult["ImagePath"];?></ImagePath>
<Link><?=$obResult["Link"];?></Link>
</item>
<?
}
?>
</images>
<?
mysql_close($objConnect);
?>
Go to : ขอวิธี php แปลงข้อมูลใน mysql database ให้เป็น xml จะนำไปใช้กับ asp.net ครับ โดยให้เรียกจาก url ของ php
|
 |
 |
 |
 |
Date :
2012-10-20 08:24:42 |
By :
mr.win |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Code (PHP)
$dataset_day_bw[] = "<set value='$row[0]' /> " ;
ใช้ array ครับ
|
 |
 |
 |
 |
Date :
2012-10-22 08:21:12 |
By :
mr.win |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 04
|