I have following activerecord code to get invoice and sum of its payment.
$this->db->select('invoice.*,customer.custid,customer.cust_name,customer.cperson,customer.cust_email,customer.cust_mobile,customer.cust_address,sum(payment_received.amount) as paid_amount');
$this->db->join('customer','customer.custid=invoice.custid');
$this->db->join('payment_received','invoice.inid=payment_received.inid','left');
$this->db->where('@paid_amount IS NULL');
Because of codeigniter escape column name with '`' this char its showing error "Unknown column '@paid_amount' in 'where clause'"
How to stop escaping of column name ??