php - how to join a two tables with arrays of datas -


my first table category contain categoryid , categories.
second table bloggers contains bloggercategory.
bloggercategory contain array of categoryid (more 1 categoryid).

function selectusercategories($sess_id)  {    $this->db->select('*');    $this->db->from('categories');    $this->db->join('bloggers', 'blogger_category = category_id');     $this->db->where('id', $sess_id);    $querycat = $this->db->get();    return $querycat->result(); } 

can join 2 tables display bloggercategory individualy array categories. tried way not working.

for comma separated field, use mysql find_in_set()

select  *    categories c join    bloggers b on      find_in_set(c.category_id ,b.blogger_category) 

Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -