Welcome Guest, Not a member yet? Register   Sign In
Pagination & slug
#1

I'm a newbie. help me please. learn in a textbook. Make the news - and it works. But with the pagination problem. How good is my code in the model?


PHP Code:
class News_model extends CI_Model {

 
       public function __construct()
 
       {
 
               $this->load->database();
 
       }
 
       
        public 
function get_news_page($slug FALSE)
 
       {
 
       
                $query 
$this->db->get_where('news', array('slug' => $slug));
 
               return $query->row_array();
 
       }
 
       
        public 
function get_news_front($num,$offset)
 
       {

 
               $this->db->order_by('id','desc');
 
               $query $this->db->get('news',$num,$offset);
 
               return $query->result_array();

 
       }
 
               

Reply




Theme © iAndrew 2016 - Forum software by © MyBB