I want to get and send data from MySQL to views in my CodeIgniter.
This is my function in my Model :
public function getProduct()
{
// EDIT : remove ; from ->from('table') and add ' ' to select ->select('*');
$a = $this->db->select('*')
-from('table')
->get();
return $a->result();
}
This is my Function in controller :
public function sendView()
{
$d['product'] = $this->model->getProduct();
$this->load->view('product', $d);
}
This is my views :
<a href="#"><?php echo $product; ?></a>
It's not getting all product data from MySQL.