/ Published in: PHP
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
public function get_recent($limit = 0) { $query = $this->db->select(' tw.id AS tw_id, t.name AS t_name, t.slug AS t_slug, tw.status AS tw_status, tw.created_date AS tw_created_date, tw.created_by AS tw_created_by, tw.rate AS tw_rate, u.id_str AS u_id_str, u.name AS u_name, u.screen_name AS u_screen_name, u.profile_image_url AS u_profile_image_url, t.name AS t_name, t.slug AS t_slug ') ->from($this->table . ' AS tw') ->order_by('tw.id', 'DESC'); if ($limit) $query = $query->limit($limit); $query = $query->get(); if ($query->num_rows() > 0) return $query->result(); else return FALSE; }