SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Aug 2004
    Location
    belgium
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    nested relations?

    I have an xml file with the taxonomic structure of birds.

    info about the birds themselves are in a database (I use php, mysql)


    example :
    class a
    subclass b
    ...
    family f
    bird id=1
    bird id=2
    family g


    what I want to output is this structure, using the info of the birds in my database.


    The easiest way would propably be to put the structure into my database as well, but there are some problems: not every 'step' in the structure is followed

    (example: in a infraorder you might except a parvorder, but sometimes it just skipse and immediately describes a family, or superfamily,... it is quite complex)


    so I guess that would only work if I had some kind of nested relation structure (maybe that wouldn't even work, I dunno)

    otherwise I need to use the xml file.


    my question is: how do I go about using this xml file in php? I think I could do it in javascript, but then I wouldn't be able to use php to get my info from the database.

    I'm new to php, mysql, javascript. I've been using xml for a while.
    so maybe there is this simple solution I'm missing?
    or a hard one ?

    *edit* I was using xsl to do this, with my info in the xml file too, but I would like to get it all into a database

  2. #2
    SitePoint Member
    Join Date
    Aug 2004
    Location
    belgium
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    basically, what I want to do is this:

    - open xml file
    - parsing xml and each time I encounter an id, i will look it up in my database and get some attributes out of it.
    - do some counting on the database


    what I already can do is get my data out of de database, but I would like it to be somewhere inbetween the stuff I get out of the xml file.


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
  •