importing xml into mysql
Posted: Tue Jan 27, 2004 7:53 am
In fact my xml file is with a tree structure (with infinit levels and sublevels) who hold data about items:
- <dir for="informatie" name="root">
<dir name="Informatie generals" subtitle="opening .." prio="3">
<dir name="Informatie generals" subtitle="opening .." prio="3">
<item id=195 accepted="true" prio="7" >
<body>
<!CDATA[ <strong> Is that my body file ... ]]>
</body>
</item>
<item id=196 accepted="true" prio="7" >
<body>
<!CDATA[ <strong> Is that my body file ... ]]>
</body>
</item>
</dir>
<dir> .....
I must create in php/mysql that tree structure with that data.
I made 3 table in mysql. First table hold information about directories, second about items and the last about id_items / id_directories (where items are in that director...)
I can read the xml file and I put that in mysql (items and directories) but I dont know how I can reconstruct the tree structure( directories tags dont have information about id ...)
Know somebody how I resolve that problems?
- <dir for="informatie" name="root">
<dir name="Informatie generals" subtitle="opening .." prio="3">
<dir name="Informatie generals" subtitle="opening .." prio="3">
<item id=195 accepted="true" prio="7" >
<body>
<!CDATA[ <strong> Is that my body file ... ]]>
</body>
</item>
<item id=196 accepted="true" prio="7" >
<body>
<!CDATA[ <strong> Is that my body file ... ]]>
</body>
</item>
</dir>
<dir> .....
I must create in php/mysql that tree structure with that data.
I made 3 table in mysql. First table hold information about directories, second about items and the last about id_items / id_directories (where items are in that director...)
I can read the xml file and I put that in mysql (items and directories) but I dont know how I can reconstruct the tree structure( directories tags dont have information about id ...)
Know somebody how I resolve that problems?