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

[eluser]Dam1an[/eluser]
Taken from the user guide
Quote:Writes a "SELECT AVG(field)" portion for your query. As with select_max(), You can optionally include a second parameter to rename the resulting field.

Code:
$this->db->select_max('age', 'member_age');
$query = $this->db->get('members');
// Produces: SELECT MAX(age) as member_age FROM members

So in the same way you aliased the SUM operation to total, you can do the same here, and then use that name to access the variable in your row


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