Having issues with sumin data from an array |
[eluser]The Revel[/eluser]
My table contains this data: Code: tid email amount date I am trying to sum the amounts based on email address (transaction details) Here is what I have while trying to debug: Code: $q2 = $this->db->query('SELECT *, SUM(amount) FROM transactions WHERE email="'. $useremail .'" GROUP BY email'); When I echo $this->data['sum'] I get "Array" and not the ammount. I am new to CodeIgniter and shamelessly have no idea what I am doing wrong. I want to pass this variable to the view page as I have a list of all the transactions, and need a total (account balance). Any help is much appreciated. Thank you. |
Messages In This Thread |
Having issues with sumin data from an array - by El Forum - 04-30-2012, 03:22 PM
Having issues with sumin data from an array - by El Forum - 04-30-2012, 03:28 PM
Having issues with sumin data from an array - by El Forum - 04-30-2012, 03:36 PM
Having issues with sumin data from an array - by El Forum - 04-30-2012, 03:38 PM
Having issues with sumin data from an array - by El Forum - 04-30-2012, 03:51 PM
|