Guest User

Untitled

a guest
Oct 21st, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.47 KB | None | 0 0
  1. <?php
  2.  
  3. if (! defined('BASEPATH')) exit('No direct script access');
  4.  
  5. class class_name extends Model {
  6.  
  7.    
  8.     //model file to the sidebar on include/header / the sidebar_helper file
  9.     function getSidebarReviews() {
  10.         $this->db->select('id, imgPath, description, date, approved');
  11.         $sidebarReviews = $this->db->get('reviews', 7);
  12.        
  13.         //Check if the sidebarReviews get something, if yes: return it
  14.         if($sidebarReviews->num_rows() > 0)
  15.         {
  16.             return $sidebarReviews->result()
  17.         }
  18.        
  19.     }
  20.  
  21. }
Add Comment
Please, Sign In to add comment