Welcome Guest, Not a member yet? Register   Sign In
MY_Model base CRUD
#61

[eluser]Mark Croxton[/eluser]
Hi Vas

Quote:I’ve modified your join function so I can related tables using more than one column.

You mean have two foreign keys in table 1 that both relate to table 2? Sounds like a curious design, but in any case you could use aliases:

http://ellislab.com/forums/viewthread/152006/#737438
#62

[eluser]Unknown[/eluser]
How does the data array look like in this..........

Code:
// insert a new record
$this->office->insert($data);

// update a record
$this->office->update($data, $office_id);

How would i pass data that cross between tables........... is this correct ?

Code:
$data = array (
   'persons' => array(
    'firstname' => 'john',
    'lastname' => 'doe',
    'othernames' => 'Kabiri',
    'email' => '[email protected]',
  
    'students' => array(
     'intake' => 'BCA-2009',  
     'admission_number' => 'BCA-001-029',  
     'date_of_admission' => strtotime('now'),  
     'former_school' => 'Former School',  
    )
   )
  );




Theme © iAndrew 2016 - Forum software by © MyBB