Welcome Guest, Not a member yet? Register   Sign In
How to structure effectively news and category relationship ?
#7

If you just want to join all articles to the associated category you just need a quey like that.

PHP Code:
$this->db->from('category')
     ->
join('news''category.cat_id = news.cat_id')
     ->
where('category.cat_id'$cat_id)
     ->
get(); 

cat_id is the matching key for both tables.

Reply


Messages In This Thread
RE: How to structure effectively news and category relationship ? - by Rufnex - 12-11-2014, 02:49 PM



Theme © iAndrew 2016 - Forum software by © MyBB