public function getCategories($id) {
$query = $this->db->query("select categoriesid,categories_name from categories where categoriesid='$id' ");
if ($query->num_rows() > 0) {
foreach ($query->result() as $row) {
$data[] = $row;
}
return $data;
}
return false;
}
/* Search */
public function search_record_count($id,$keyword) {
$this->db->like('title',$keyword);
$this->db->where('categories',$id);
$this->db->from('article');
return $this->db->count_all_results();
}
public function search_fetch_countries($id,$keyword, $limit, $start) {
$query = $this->db->query("select * from article left join user on post_by=userid where categories='$id' and title like '%$keyword%' order by id desc limit $start, $limit");
if ($query->num_rows() > 0) {
foreach ($query->result() as $row) {
$data[] = $row;
}
return $data;
}
return false;
}
/* Search */