I have a controller which looks like
class Products extends CI_Controller {
public function __construct(){
//
parent::__construct();
}
public function index() {
//
$this->load->model('products_model');
$data = $this->products_model->getProducts();
$this->load->view('products',$data);
}
}And model using Active Record
class Products_model extends CI_Model {
private function getMake()
{
$this->db->order_by('make');
return $this->db->get('manufacturer');
}
public function getProducts() {
$meta_title = "Meta Title";
$meta_keywords = "keywords";
$meta_description = "Page description";
$make = array('' => 'Select a make')+$this->getMake();
return array("make" => $make, "meta_title" => $meta_title,"meta_keywords" => $meta_keywords,"meta_description" => $meta_description);
}
}And a view which is a simple drop down for make:
<? echo form_dropdown('make',$make,$this->input->post('make')); ?>Whole combination above throws me an error ‘Object of class CI_DB_mysql_result could not be converted to int’ on a line
$make = array('' => 'Select a make')+$this->getMake();Any clue why?
Thanks