コードイグナイタープロジェクトは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();
}
私はこの1つは非常に簡単であるビュー
テーブルのエイリアスでは大文字と小文字が区別されます。 –
はいそれは持っています – Guzzyman