Good afternoon, I would like to request your help in something that I have broken my mind to solve and I can not fix it to work out
I have 4 tables
The tables will have enough information and did not want to leave everything in one .. so I think it's better to divide the information to 4.
I have tried several ways and I can not do it.
I can list the products and call everything right this way domain.com/products/ver/productname
NA MODEL / ProductModel - my basic query where I can bring all the data from the table products
public function find($slug){ //
$this->db->where('slug', $slug);
return $this->db->get('productos')->row();
}
However,
public function find($slug){ //
$this->db->where('slug', $slug);
$this->db->select("productos.slug");
$this->db->from('productos');
$this->db->join('prodnutri', 'prodnutri.idNutricion = productos.slug');
$query = $this->db->get();
return $this->db->get('productos')->row();
}
NO CONTROLLER / products
public function ver($slug)
{
$this->load->view('incluir/cabecalho');
$data['producto'] = $this->ProductModel->find($slug);
$this->load->view('productos/producto', $data);
$this->load->view('incluir/rodape');
}
The problem is that I'm not able to query the model (I think the controller is right! because all the data of the product table it brings right, but when I want to bring the data of the other tables it is giving error ..
PHP Error was encountered Severity: Notice Message: Undefined property: stdClass :: $ portion
in view to using vector so
<?Php echo $producto->titulo;?> -- titulo da tb Productos
<?Php echo $producto->porcion;?> -- titulo da tb prodnutri
Someone can help, I will be very grateful in a light to solve the table with inner join ..