Active record query to single row result object


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.