Professional Web Applications Themes

hierarchy information - MySQL

How do I go about representing hierarchy information in a table? Do I use a field to determine it(say a "level" and use the position in the table to determine it) or is there a better way? essentially I am going to store "comments" and need to keep the heirarchy in some way but I'm not sure the "best" way. Seems like a waste to use an extra field but that might be the easiest. What I mean is that if I have something like 1 1.1 1.2 1.2.1 1.2.2 1.2.3 1.3 2 2.1 2.1.1 2.1.2 2.2 etc... so I ...

  1. #1

    Default hierarchy information

    How do I go about representing hierarchy information in a table? Do I use a
    field to determine it(say a "level" and use the position in the table to
    determine it) or is there a better way?


    essentially I am going to store "comments" and need to keep the heirarchy in
    some way but I'm not sure the "best" way. Seems like a waste to use an extra
    field but that might be the easiest.

    What I mean is that if I have something like

    1
    1.1
    1.2
    1.2.1
    1.2.2
    1.2.3
    1.3
    2
    2.1
    2.1.1
    2.1.2
    2.2
    etc...


    so I could just store the "level" in the table.

    I won't have any need to remove rows so that might help.

    Thanks,
    Jon


    Jon Guest

  2. #2

    Default Re: hierarchy information

    On 14 Jun, 07:52, "Jon Slaughter" <com> wrote: 

    Take a look at:
    http://dev.mysql.com/tech-resources/articles/hierarchical-data.html

    Captain Guest

  3. #3

    Default Re: hierarchy information


    "Captain Paralytic" <com> wrote in message
    news:googlegroups.com... 
    >
    > Take a look at:
    > http://dev.mysql.com/tech-resources/articles/hierarchical-data.html
    >[/ref]

    Thanks
    Jon


    Jon Guest

Similar Threads

  1. What is the structure hierarchy here?
    By Doru in forum ASP.NET Data Grid Control
    Replies: 3
    Last Post: February 14th, 09:15 PM
  2. Hierarchy in user management
    By Bob Gregory in forum ASP.NET Security
    Replies: 4
    Last Post: September 23rd, 04:02 PM
  3. mc hierarchy rearrangement
    By joox webforumsuser@macromedia.com in forum Macromedia Flash Actionscript
    Replies: 2
    Last Post: February 5th, 03:02 PM
  4. Determining Table Hierarchy
    By Jake in forum Oracle Server
    Replies: 3
    Last Post: January 13th, 10:08 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139