Results 1 to 2 of 2

Thread: adjacency listing?

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Nov 1999
    Posts
    1,337

    adjacency listing?

    well let me try to expalin what I am trying to do.

    I have a db table like so

    subcategory1

    Code:
    subid1    categoryID1    fatherID    name
        1       20            0          link4
        2       0             1           link5
        3       0             2           link6
        4       0             3          link7
    so it is explained like so. link4 is assocciated with link3 by categoryID1 which is 20 (id of category link3, another table) and link5 is assocciated to link4 by fatherid and link6 is assocciated to link5 by fatherID and so on. this is called adjacency list method I think.

    so with that table layout I can produce code like so

    link / link2 / link3 / link4 /
    link / link2 / link3 / link4 / link5
    link / link2 / link3 / link4 / link5 / link6
    link / link2 / link3 / link4 / link5 / link6 / link7

    and link - link3 is another table but we don't have to worry about it right now.

    so the code attached works a charm for something like this, but when you add say link5.5 to the db and associate it to link5 then link7 gets booted out. according to the code it queries the db depending on the last subid1 of the last link. this would get link5.5 and link6 and nothing else


    Code:
    subid1    categoryID1    fatherID    name
        1          20         0        link4
        2          0           1        link5
        3          0           2        link6
        4          0           3        link7
        5          0           2        link5.5
    can you see what I am getting at? I need a way to get all of them that are associated to link4.

    any takers on this?
    Attached Files Attached Files

  2. #2

    Thread Starter
    Frenzied Member
    Join Date
    Nov 1999
    Posts
    1,337
    13 people looked at it and nobody downloaded it. hmm I must be the greatest php'er in the world. nobody can answer my questions.

Posting Permissions

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



Click Here to Expand Forum to Full Width