Advertisement
jamboljack

Articles Model

Oct 12th, 2014
364
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.39 KB | None | 0 0
  1. class Articles_model extends CI_Model {
  2.    
  3.     function __construct() {
  4.         parent::__construct(); 
  5.     }
  6.    
  7.     function select_articles($limit = 4) {
  8.         $this->db->select('*');
  9.         $this->db->from('nama_tabel');
  10.         $this->db->limit($limit);  
  11.         $this->db->order_by('tgl_input' , 'desc');
  12.        
  13.         return $this->db->get();       
  14.     }
  15.  
  16.     function count_all() {
  17.         return $this->db->count_all('nama_tabel');
  18.     }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement