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 6078043
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T10:47:20+00:00 2026-05-23T10:47:20+00:00

I am developing a tree view forum with PHP, MVC, and AJAX. My database

  • 0

I am developing a tree view forum with PHP, MVC, and AJAX. My database has two tables, as follows:

thread

  • id_thread
  • name
  • creator
  • date
  • description
  • parent_id

answer

  • id_answer
  • answer
  • message
  • user
  • date

I am trying to develop a forum with n threads, that I would like to visually present in a tree view. I am confused on how to get started with creating this tree view.

My approach is in the first level of threads is just autoincrement, then when the user click a thread, the parent_id of the next thread is the parent_id of the fist level, and so on. Is there a better way to structure my data?

Any advice would be helpful, as I am a beginner trying to get started. Thank you for your time.

  • 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-05-23T10:47:20+00:00Added an answer on May 23, 2026 at 10:47 am

    I’ve found the best way to display this client-side this is with the YUI TreeView.

    Basically, you can pass it data in a variety of different formats (JSON is usually used) and it will generate this interactive tree in a div for you.

    YUI TreeView Example

    You can then add listeners for specific events, such as clicks and what not.

    Here is an example: http://developer.yahoo.com/yui/examples/treeview/default_tree.html

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

Sidebar

Related Questions

I am developing a disk based tree for a database engine and i like
I'm developing a Linux kernel module outside of the Linux source tree (in the
Hi every body i am developing a MVC application, and i want to use
Currently I'm developing a multi-thread application. I use a TreeView to display the states
I am developing an interpreter of a simple programming language. There are tree-structured dynamic
I'm developing a Winforms application which has been running for years with an explorer
I am developing publishing site and it will have complex tree structure. Is there
I am developing a pyramid game that uses a Minimax tree that searches for
I'm thinking about developing my own PHP based gallery for storing lots of pictures,
I am developing a easy forum system, and it is using the hierarchy data

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.