Sunday, July 24, 2011

Re: [phpXperts] codeigniter and mysql inner join creating problem

 

I suggest you to first implement with sql than try to implement it in codeigniter.

ARIF MAHMUD RANA


From: asma tuli <asmatuli@gmail.com>
To: phpexperts <phpexperts@yahoogroups.com>
Sent: Saturday, July 23, 2011 2:25 PM
Subject: [phpXperts] codeigniter and mysql inner join creating problem

 
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.


__._,_.___
Recent Activity:
Visit phpXperts website at www.phpxperts.net
.

__,_._,___

No comments:

Post a Comment