Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8507261
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T02:49:12+00:00 2026-06-11T02:49:12+00:00

I am new to CI. Now i am try to develop the comment system

  • 0

I am new to CI.

Now i am try to develop the comment system with reply option.

So far i have developed the insert comment and reply comment.

But i don’t know how to fetch reply comments under the main comment.

Please help me.

Thanks to all

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T02:49:14+00:00Added an answer on June 11, 2026 at 2:49 am

    Use a recursive function! For that you will need to do something like this:

    1. Get the first comment.
    2. Call the recursive function. The ID of the comment must be passed as an argument.
    3. The function must get the comments & call itself in order to get all the comments.

    A pseudo-code of this schema will be:

    myComment = getComment();
    recursiveComments(myComment);
    
    function recursiveComments(currentComment){
      print(currentComment);
      replies = getReplies(currentComment['idComment']);
      foreach(replies as reply){
         recursiveComments(reply);
      }
    }
    

    In the pseudo-code, I’m assuming that you get a row_array with the getComment() function & that this comment is the “head” of all the comments, like the initial post.
    After that, I call the recursive function which gets all the replies & sub-replies for each comment. Note the I fetch a single reply in each call to the function.

    Hope this gives you an idea! (=

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm pretty new to ruby an I try to develop something currently. But I
I'm quite new to ZF, and right now, i try to write a tiny
new on rails and using windows for now,, i have web page that user
I am now trying to create new database manager under Fragment class. But unfortunately,
I would like to know now days with the new PalmOS Web development platform
I am new to Ruby on Rails, Now try to install ROR. I follow
I just started to develop with Google AppEngine and now I have my first
I am new to android and am trying to develop an app. I have
I have a quick little application and wanted to give a try to develop
Im new in jetty and i try do develop a little application that uses

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.