0
我發現我們網站的這個php代碼,它將機器數據庫中的機器值報告到網站上。將數據庫值除以10並更新Web服務器
function get_cycledata($serial)
{
$rows=array();
$this->db->select('cycle_timestamp,cycle_18_INT,cycle_03_INT,cycle_06_INT,cycle_08_INT,cycle_17_INT');
$this->db->from('cycles');
$this->db->where('cycle_serial', $serial);
$this->db->order_by("cycle_timestamp","desc");
$q = $this->db->get();
foreach($q->result_array() as $row)
{
$row['cycle_timestamp'] = $this->reports_model->time_convert($row['cycle_timestamp']);
$rows[]=$row;
}
return $rows;
}
我想通過顯示其放到網站報告頁面之前除以10,整型值編輯值「cycle_06_INT」和「cycle_08_INT」。我怎麼做?
我試過,但在重新加載頁面時,它返回一個錯誤說: 數據庫出錯 錯誤編號:1054 未知列'cycle_serial'中的'cycle_06_INT/10' SELECT'cycle_timestamp','cycle_18_INT','cycle_03_INT','cycle_06_INT/10','cycle_08_INT/10','cycle_17_INT' FROM('cycles')WHERE' ='0CSA000002'ORDER BY'cycle_timestamp' desc 文件名:models/reports_model.php 行號:63 –