[ Mini Kiebo ]
Server: Windows NT AKFAR_SERVER 10.0 build 26200 (Windows 10) AMD64
Path:
D:
/
xampp
/
htdocs
/
lppm
/
compro
/
application
/
models
/
[
Home
]
File: Model_category.php
<?php defined('BASEPATH') OR exit('No direct script access allowed'); class Model_category extends CI_Model { public function all_news_by_category_id($id) { $query = $this->db->query("SELECT * FROM tbl_news WHERE category_id=? ORDER BY news_id DESC", array($id)); return $query->result_array(); } public function category_by_id($id) { $query = $this->db->query("SELECT * FROM tbl_category WHERE category_id=?", array($id)); return $query->first_row('array'); } public function category_check($id) { $sql = 'SELECT * FROM tbl_category WHERE category_id=?'; $query = $this->db->query($sql,array($id)); return $query->num_rows(); } }