$sum_rc="select sum(paid_rc) as sum_paid from roomcharge where id='$id' and stat_rc='ok' ";
$query_sum=mysql_query($sum_rc);
$result = mysql_fetch_array($query_sum);
echo "total = ".$result["sum_paid"];
ล่วงหน้าน่ะ
$sum_rc="select sum(paid_rc) from roomcharge where id='$id' and stat_rc='ok' ";
$query_sum=mysql_query($sum_rc);
$sum_rc="select sum(paid_rc) as sum_paid from roomcharge where id='$id' and stat_rc='ok' ";
$query_sum=mysql_query($sum_rc);
$result = mysql_fetch_array($query_sum);
echo "total = ".$result["sum_paid"];
Date :
2014-09-14 17:48:48
By :
Sasa
No. 15
Guest
ขอช่วยจากผู้รู้ช่วยอธบายโค๊ตนี้ ในแต่ละบรรทัดหน่อยค่ะ ขอบคุณล่วงหน้าน่ะค่ะ
$sum_rc="select sum(paid_rc) from roomcharge where id='$id' and stat_rc='ok' ";
$query_sum=mysql_query($sum_rc);
$sum_rc="select sum(paid_rc) as sum_paid from roomcharge where id='$id' and stat_rc='ok' ";
$query_sum=mysql_query($sum_rc);
$result = mysql_fetch_array($query_sum);
echo "total = ".$result["sum_paid"];