Welcome Guest, Not a member yet? Register   Sign In
news category and subcategory
#5

That's my fault, replace the code by this one :

PHP Code:
$query $this->db->from("news")
                ->
join("cat""news.cat_id = cat.cat_id")
                ->
where("cat.cat_id""1")
                ->
or_where("parent_id""1")
                ->
get();      
  return 
$query->result(); 

You can also do it like this to avoid using a var that wouldn't be used later :

PHP Code:
return $this->db->from("news")
                ->
join("cat""news.cat_id = cat.cat_id")
                ->
where("cat.cat_id""1")
                ->
or_where("parent_id""1")
                ->
get()
                ->
result(); 
Reply


Messages In This Thread
news category and subcategory - by paju89 - 12-10-2014, 05:14 AM
RE: news category and subcategory - by _this - 12-10-2014, 07:32 AM
RE: news category and subcategory - by paju89 - 12-10-2014, 08:57 AM
RE: news category and subcategory - by paju89 - 12-10-2014, 08:47 AM
RE: news category and subcategory - by _this - 12-10-2014, 08:59 AM
RE: news category and subcategory - by paju89 - 12-10-2014, 09:04 AM
RE: news category and subcategory - by _this - 12-10-2014, 12:24 PM



Theme © iAndrew 2016 - Forum software by © MyBB