[eluser]dimaomni[/eluser]
Hi,
How to correct return multiply data from Model ($data['getid']), to get possibility access data the same as $data['query'] . Like:
View:
Code:
foreach ($getid as $a){
$a->customer_id;
} echo $a;
------------------------------------
Controller:
Code:
$data['query'] = $this->Mcustomer->view_customer();
$data['getid'] = $this->Mcustomer->get_id();
$this->load->view('admin/wcustomer',$data);
Model:
Code:
function get_id(){
$getid1 = $this->db->query("SELECT MAX(`customer_id`)FROM `customer`");
$getid2 = $this->db->query("SELECT MAX(`branch_id`)FROM `branch`");
$getid3 = $this->db->query("SELECT MAX(`equipment_id`)FROM `equipment`");
$getid4 = $this->db->query("SELECT MAX(`contact_id`)FROM `contact`");
return array('customer_id'=>$getid1, 'branch_id'=>$getid2,'equipment_id'=>$getid3,'contact_id'=>$getid4);