Try this...
$sql = $this->db->select('*')
->from('tbl_customer')
->join('tbl_sales','tbl_sales.customer_id = tbl_customer.customer_id')
->get();
return $sql->result();
my model
function get_customer()
{
$this->db->select('*');
$this->db->from('tbl_customer');
$this->db->join('tbl_sales', 'tbl_sales.customer_id = tbl_customer.customer_id');
$query = $this->db->get();
return $query->result();
}
my controller
function index()
{
$this->load->model('sh_model');
$variable['customer'] = $this->sh_model->get_customer();
$this->load->view('sh_view', $variable);
}
my view
foreach($customer as $item)
{
echo $item->customer_id;
echo $item->customer_first_name;
}
I am getting no result.
--
:: Md.Shoriful Islam Ronju ::
http://blog.smronju.com
No comments:
Post a Comment