ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

MY_Model base CRUD

April 10, 2010 6:41pm

Subscribe [14]
  • #61 / Dec 02, 2010 10:27am

    Mark Croxton

    319 posts

    Hi Vas

    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 / Apr 04, 2013 7:41am

    Smoken

    1 posts

    How does the data array look like in this….......

    // 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 ?

    $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',  
        )
       )
      );
.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases