Welcome Guest, Not a member yet? Register   Sign In
Outputting Select Sum
#2

[eluser]Dam1an[/eluser]
The "other stuff" is just the key in the array
You could always alias it using 'AS' and then use that key in the array to get just the value

Code:
function revenue ()
    {
    $query = $this->db->select('SUM(summe) AS `total`', FALSE)
    ->from('orders')
    ->where('hidden', 0)
    ->get();
                                            
    $row = $query->row_array();
    return $row['total'];
    }

Obviously put a check to make sure it's set and what not before you convert query to row_array Wink


Messages In This Thread
Outputting Select Sum - by El Forum - 08-25-2009, 09:17 AM
Outputting Select Sum - by El Forum - 08-25-2009, 09:24 AM
Outputting Select Sum - by El Forum - 08-25-2009, 09:38 AM
Outputting Select Sum - by El Forum - 08-25-2009, 10:16 AM
Outputting Select Sum - by El Forum - 08-25-2009, 11:14 AM
Outputting Select Sum - by El Forum - 08-25-2009, 11:19 AM
Outputting Select Sum - by El Forum - 08-26-2009, 02:32 AM
Outputting Select Sum - by El Forum - 08-26-2009, 02:47 AM
Outputting Select Sum - by El Forum - 08-26-2009, 09:47 AM



Theme © iAndrew 2016 - Forum software by © MyBB