👁 View: Model_category.php
Path: /home/thiqat5/webcms.thiqatech.com/application/models/Model_category.php
Size: 570 B · Modified: 2022-08-23 21:47:34 · Perm: 0644 · Writable
<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Model_category extends CI_Model 
{
    public function get_category_data($id)
    {
        $sql = "SELECT * FROM tbl_news_category WHERE category_id=?";
        $query = $this->db->query($sql,array($id));
        return $query->result_array();
    }
    public function get_news_data($id)
    {
        $sql = "SELECT * FROM tbl_news WHERE category_id=? ORDER BY news_id ASC";
        $query = $this->db->query($sql,array($id));
        return $query->result_array();
    }
}