我正在为“价格”栏目的总销售额创建一个代码,我做得对吗???
public function gettotalsales()
{
$stmt = $this->conn->prepare("Select SUM(Price) From tbl_orderlist where Price != '' ");
$stmt->execute();
return $stmt;
}
答案 0 :(得分:1)
您只需编写以下行
Select SUM(Price) From tbl_orderlist
答案 1 :(得分:0)
Select SUM(Price) From tbl_orderlist