Posted By

audiopleb on 10/18/10


Tagged

codeigniter


Versions (?)

Active record query to single row result object


 / Published in: PHP
 

  1. //Model
  2.  
  3. function name()
  4. {
  5. $this->db->select('column_name');
  6. return $this->db->get('db_name');
  7. }
  8.  
  9. //Controller
  10.  
  11. $data['row'] = $this->db->name($var)->row();
  12.  
  13. //view
  14.  
  15. <?=$row->column_name;?>

Report this snippet  

You need to login to post a comment.