Welcome Guest, Not a member yet? Register   Sign In
Multidimensional arrays
#5

[eluser]hvalente13[/eluser]
If that doesn't work you could do it more manually in your model:
Code:
function get_client_details($id){
  $query = //get the data from the client_details table
}

do the same for the other tables:

Code:
function get_client_sites($id){
  $query = //get the data from the client_sites table
}

function get_client_contacts($id){
  $query = //get the data from the client_contacts table
}

Then in your controller you build your array:

Code:
$id = $this->uri->segment(3); // this is the client id that's the same for all tables... assuming that the tables are built in this way

$$data['client_details'] = array('0' => $this->mymodel->get_client_details($id),
  'client_sites' => $this->mymodel->get_client_sites($id),
  'client_contacts' => $this->mymodel->get_client_contacts($id),
);

$this->load->view('myview',$data);

Then you'll have to work them as database results in your view:

Code:
foreach ($client_details[0]->result() as $row){}

and

Code:
foreach ($client_details['client_sites']->result() as $row){}

Of course you have to do some data validation like some ifs

Hope this helps


Messages In This Thread
Multidimensional arrays - by El Forum - 07-18-2008, 08:20 AM
Multidimensional arrays - by El Forum - 07-18-2008, 08:47 AM
Multidimensional arrays - by El Forum - 07-18-2008, 08:58 AM
Multidimensional arrays - by El Forum - 07-18-2008, 09:00 AM
Multidimensional arrays - by El Forum - 07-18-2008, 09:18 AM
Multidimensional arrays - by El Forum - 07-18-2008, 10:40 AM
Multidimensional arrays - by El Forum - 07-18-2008, 01:02 PM
Multidimensional arrays - by El Forum - 07-18-2008, 01:43 PM
Multidimensional arrays - by El Forum - 07-18-2008, 01:50 PM
Multidimensional arrays - by El Forum - 07-18-2008, 09:33 PM



Theme © iAndrew 2016 - Forum software by © MyBB