Welcome Guest, Not a member yet? Register   Sign In
codeigniter and mysql inner join creating problem
#1

[eluser]foysal[/eluser]
my model
Code:
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

Code:
function index()
    {
      $this->load->model('sh_model');
      $variable['customer'] = $this->sh_model->get_customer();
      $this->load->view('sh_view', $variable);
    }


my view

Code:
foreach($customer as $item)
    {
       echo $item->customer_id;
       echo $item->customer_first_name;
    }



I am getting no result. Even no error coming.

If you have good tutorial on mysql inner join and codeigniter, please share with me.


foysal


Messages In This Thread
codeigniter and mysql inner join creating problem - by El Forum - 07-23-2011, 10:30 AM
codeigniter and mysql inner join creating problem - by El Forum - 07-23-2011, 11:37 AM
codeigniter and mysql inner join creating problem - by El Forum - 07-23-2011, 08:11 PM
codeigniter and mysql inner join creating problem - by El Forum - 07-23-2011, 08:26 PM



Theme © iAndrew 2016 - Forum software by © MyBB