Query Builder Class |
Can someone please explain the following code related to the query builder class?
$this->db->select('(SELECT SUM(payments.amount) FROM payments WHERE payments.invoice_id=4) AS amount_paid', FALSE); $query = $this->db->get('mytable');
That is selecting a subquery results as a column called "amount_paid".
Not overly sure what you're asking. |
Welcome Guest, Not a member yet? Register Sign In |