在html中透過以下程式碼可以得到mysql執行後的資料
$sql = "SELECT MAX(yj), AVG(yj), Min(yj) FROM " . $this->get_table('item') . ' where category_id = ' . intval($category_id);
<?php
$biuuu = $this->avgprice;
$pr = (implode('',$biuuu));
$prr = floor($pr);
echo $prr;
?>
得出1136922
怎麼把得出的結果這樣分割
最大值是113,平均值是69,最小值是22
给我你的怀抱2017-05-16 13:00:53
先改下sql
SELECT MAX(yj) as m_max, AVG(yj) as m_avg, Min(yj) as m_min FROM " . $this->get_table('item') . ' where category_id = ' . intval($category_id);