获取第一行的记录,但希望获取特定 MemberID 表中可用的所有记录
order_fetch.php
<?php
$objConnect = mysql_connect("localhost","root","");
$objDB = mysql_select_db("android");
$strMemberID = $_POST["sMemberID"];
$strSQL = "SELECT * FROM order_details WHERE MemberID = '".$strMemberID."' ";
$objQuery = mysql_query($strSQL);
$obResult = mysql_fetch_array($objQuery);
if($obResult)
{
$arr["OrderID"] = $obResult["OrderID"];
$arr["MemberID"] = $obResult["MemberID"];
$arr["TotalAmount"] = $obResult["TotalAmount"];
$arr["ItemDetails"] = $obResult["ItemDetails"];
}
mysql_close($objConnect);
echo json_encode($arr);
?>