Welcome Guest, Not a member yet? Register   Sign In
nesting mysql results, need help passing the array to my view
#4

[eluser]skattabrain[/eluser]
thanks for your insights ... thank you very much.

this is what i did shortly after my post ...

Code:
$comments = $this->Profile_data->getCoComments($clientID);
$data['comments'] = $comments;
            
if ($comments->num_rows() > 0)
{
  foreach ($comments->result() as $comment)
   {
     $replies = $this->Profile_data->getReplies($comment->commentID);
     $data["replies"][$comment->commentID] = $replies;
   }
}

then in my view inside the comment loop, i do this ...

Code:
if($replies[$comment->commentID]->num_rows() > 0):
foreach($replies[$comment->commentID]->result() as $reply):
etc ...


Messages In This Thread
nesting mysql results, need help passing the array to my view - by El Forum - 05-16-2008, 02:01 PM



Theme © iAndrew 2016 - Forum software by © MyBB