[eluser]blupixelz[/eluser]
I'm new to MVC and IC and I need some help with "select sum."
I have the following code and I keep on getting the following error - "Undefined property: CI_DB_mysql_result::$total_price"
I thought I had already defined a new property name 'total_price'...
This is what I want it to do in MySQL...
Code:
SELECT SUM(price) AS 'total_price' FROM movies
WHERE year(date_added) = '2007'
And I'm sure that this is exactly same as the MySQL statement above.
Code:
$this->db->select_sum('movies.price','total_price');
$this->db->where('year(movies.date_added)',$_POST['year']);
$data['query_total'] = $this->db->get('movies');
But why is my IC code causing an error in View?
Code:
<?=$query_total->total_price?>