Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
codeigniter [2011/03/07 21:04] rfilecodeigniter [2011/03/07 21:09] (current) rfile
Line 143: Line 143:
 </code> </code>
 </box> </box>
-<box>+<box|use of row_array()>
 <code php> <code php>
   /**   /**
Line 170: Line 170:
  
 </code> </code>
 +</box>
 +<box | second database>
 +<code php>
 +
 +<?php
 +class Model_old_info extends CI_Controller {
 +
 +       function __construct()
 +       {
 +            parent::__construct();
 +            // Your own constructor code
 +            $CI =& get_instance() ;
 +       $CI->oldbp = $this->load->database('oldbp', TRUE);
 +       $this->oldbp =& $CI->oldbp;
 +       }
 +       function get_old_records() {
 +
 +
 +       $table_name = 'old_blood_pressure' ;
 +       $oldbprec = $this->oldbp->get($table_name);
 +       foreach ($oldbprec->result()as $row) {
 +             $table_data[] = $row ;
 +          }
 +          return $table_data;
 +   }
 +       }
 +
 +</code>
 +
 +
 +
 +'oldbp' is in the codeigniter database config file
 +
 +
 </box> </box>