Welcome Guest, Not a member yet? Register   Sign In
join problem
#1

[eluser]Jim-Bingo[/eluser]
Hi!

I have a problem with my Join.

Code:
$this->db->select('*, news.date as newsdate, news.content as newscontent');
$this->db->from('news');
$this->db->join('news_comments', 'news_comments.nid = news.id');
$this->db->limit('3');
          
$query = $this->db->get();
          
return $query;

I want it to print out the news and all comments that belong to it.

Like this

News 1
comment
comment
comment

News 2
comment
comment

News 3
comment
comment

How do I do that?

Hope you understand. Sorry for my bad english.


Messages In This Thread
join problem - by El Forum - 06-22-2008, 04:31 AM
join problem - by El Forum - 06-22-2008, 03:01 PM
join problem - by El Forum - 06-23-2008, 10:47 AM



Theme © iAndrew 2016 - Forum software by © MyBB