我有一個代碼點火器項目託管here,但我有錯誤號碼:1054 'on子句'中顯示的未知列'p.id'網站。如何解決我的代碼中的錯誤1054點火器查詢
下面是提供此錯誤的sql查詢。
public function get_popular()
{
// Using active records
$this->db->select('P.*, COUNT(O.product_id) as total');
$this->db->from('orders AS O');
$this->db->join('products AS P', 'O.product_id = p.id','INNER');
$this->db->group_by('O.product_id');
$this->db->order_by('total','desc');
$query = $this->db->get();
return $query->result();
}
與這行代碼竊喜問題
$this->db->join('products AS P', 'O.product_id = p.id','INNER');
該項目是我的本地機器上正常工作,直到我主持它這裏查看
表別名區分大小寫。 –
是的它確實有 – Guzzyman