I have three tables, like this:
#Blog:
ID | Title
1 "My first blog"
2 "My second blog"
#Tags:
ID | Name
1 "Sport"
2 "Music
#tag_blog
Blog_id | Tag_id
1 1
2 1
2 2
And I want to display them in my web page as
Blog_title Tag_name
My first blog Sport
My second blog Sport, Music
in php file am doing somthing like
if ($query->num_rows() > 0)
{
foreach ($query->result() as $row)
{
echo $row->title;
echo $row->tag;
}
}
But as I use a join, its display 3 lines with 1 tag by lines. Any idea to get the expected results?