Jump to content

php & mysql hierachical order


mayman212

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.