SHOW:
|
|
- or go back to the newest paste.
| 1 | <?php | |
| 2 | public function all_infografis($index=0) {
| |
| 3 | $this->output->cache(10); | |
| 4 | $date = new DateTime("now");
| |
| 5 | $curr_date = $date->format('Y-m-d H:i:s');
| |
| 6 | $this->db->select('miol_nuntium.title, miol_nuntium.slug, miol_nuntium.image, miol_nuntium.content, miol_nuntium.summary, miol_nuntium.status, miol_nuntium.datepublish, miol_nuntium.id as idsm, micom_compartments.id, micom_compartments.title as nama');
| |
| 7 | $this->db->from('miol_nuntium');
| |
| 8 | $this->db->join('micom_compartments', 'micom_compartments.id = miol_nuntium.compartment','left');
| |
| 9 | //$this->db->where('is_headline', 1);
| |
| 10 | $this->db->limit(20, $index); | |
| 11 | //$this->db->where('status', 'published');
| |
| 12 | $this->db->order_by('miol_nuntium.datepublish','desc');
| |
| 13 | $this->db->where('miol_nuntium.datepublish <=', $curr_date);
| |
| 14 | $this->db->where('miol_nuntium.status', 'published');
| |
| 15 | $this->db->where('miol_nuntium.compartment', '90');
| |
| 16 | - | $query = $this->db->query("SELECT COUNT(*) FROM miol_nuntium"); ----> disini error bg
|
| 16 | + | |
| 17 | - | return $query->result_array(); |
| 17 | + | $query = $this->db->query("SELECT COUNT(*) c FROM miol_nuntium");
|
| 18 | $data = $query->result_array(); | |
| 19 | $this->db->reset_query(); // karena yg di atas sudah tidak digunakan kembali jd di hapus aja | |
| 20 | return $data; | |
| 21 | //----> disini error bg | |
| 22 | //return $query->result_array(); | |
| 23 | } |