Jump to content

Recommended Posts

hello all.

I have a list of records, which each have a comment button, just like any forum does. when I click on the comment button it brings up the current record at the top, and a blank form, to which you enter in information.

 

When I submit this information, I want it to show up on the main page as a child of the parent record. I want it similar to the example I've shown below:

id name         dob           address              email                  username
1  john smith   10/11/1986    124 Peermont Drive   john.smith@yahoo.com   john smith1
  >>  2   Harry        15/12/1985     98 The Roundhay     harry@gmail.com        harry23
    >>>  3  jhk          08/11/1976     65 dfgdfg           gfdfg@ yahoo.com       jhk345
4  john smith   10/11/1986    124 Peermont Drive   john.smith@yahoo.com   john smith1
     >> 5 Harry        15/12/1985     98 The Roundhay     harry@gmail.com        harry23
        >>>> 6  jhk          08/11/1976     65 dfgdfg           gfdfg@ yahoo.com       jhk345

 

I've been stuck on this for hours, and I haven't got anywhere. Any ideas?

Link to comment
https://forums.phpfreaks.com/topic/251256-php-mysql-hierachical-order/
Share on other sites

You can attack that challenge from a number of ways; you could use client logic and organize the data with html, css and javascript, you could run a join query (depending on your table structure) and return everything in an associative array ... etc ... the list goes on.

 

Generally, on this forum, you'll find a ready supply of folks (like myself and ManiacDan), highly skilled in LAMP technologies and web development; that are ready to donate their time and troubleshoot/diagnose problematic code or misinformed developers (the latter seeming to be the more common encounter). However, posts that seem to solicit someone designing a solution for you, will usually get little to no attention.

 

So, try a come up with a solution on your own; when/if it doesn't work or you can't figure out the code that you have written, post it here and we'll be more than happy to help. The goal is to teach and learn; you don't learn by having it done for you.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.