我有一個名爲Bills的類,它在調用它時返回三個值。功能上的類打印值
function GetCashierDetail ($UserID){
$GetCashierID = "SELECT cashiers_CashierID,cashiers_Total,cashiers_Last_Total
FROM `cashiers`
WHERE `cashiers_CashierCloseDate` is null and `cashiers_Status`='0'
and `cashiers_Delete` = '0' and `cashiers_User` = '".$UserID."'";
$objQueryCashierID = mysql_query($GetCashierID) or die ("Error Query [".$strSQL."]");
$GetCashierIDResult = mysql_fetch_array($objQueryCashierID);
$BillsCashierID = $GetCashierIDResult['cashiers_CashierID'];
$CashierTotal=$GetCashierIDResult['cashiers_Total'];
$CashierLastTotal=$GetCashierIDResult['cashiers_Last_Total'];
$num=mysql_affected_rows();
// Return Data
return $cashier_data = array('cashierId'=>$BillsCashierID ,
'CashierTotal'=>$CashierTotal ,
'CashierLastTotal'=>$CashierLastTotal);
}
現在,當調用這個函數
$BillDraftSubmit = new Bills;
$BillDraftSubmit->GetCashierDetail(71);
我需要打印$ cashier_data可變這樣
$ ID = $ BillsCashierID 使用它的其他方式。
我怎麼可以閱讀從類
爲什麼你要問相同的陣列問題在30分鐘前? http://stackoverflow.com/questions/15166127/return-multiple-value-from-function – 2013-03-01 21:41:20
沒有它的不同在這裏是類和最後它的功能:) – 2013-03-01 21:42:30
它更好地閱讀更多關於PHP基礎知識(數組和對象)然後去其他先進的一步... – 2013-03-01 21:43:32