Parse xml to mysql according to the xml tree structure --- php

Source: Internet
Author: User
What is the difference between xml_parser_create () and simplexml_load_file? What are the differences between the methods of parsing sax, dom, xmlreder, and what? I want to parse the xml and insert it into mysql. Then the structure displayed on the page should be the same as the tree structure in xml. But after inserting the first root, how can we prevent the second root from being split? The third is in the branch,

What is the difference between xml_parser_create () and simplexml_load_file? What are the differences between the methods of parsing sax, dom, xmlreder, and what? I want to parse the xml and insert it into mysql. Then the structure displayed on the page should be the same as the tree structure in xml. But after inserting the first root, how can we prevent the second root from being split? The third is in the branch,

What is the difference between xml_parser_create () and simplexml_load_file?

There are also sax, dom, xmlreder, and something.AnalysisWhat are the differences between methods?
I want to import this xmlAnalysisInsert it to mysql, and the structure displayed on the page must be the same as that shown in xml.Tree Structure. But after inserting the first root, how can we prevent the second root from being split? The third is in the branch. A buddy says he wants to return the parent id of the previous one. How can this problem be solved? AllAnalysisAfter inserting the file, insert one file each time...

Just like recursion, the root of the First insert read is the branch in the First insert. After all the inserts are completed, the second branch is read .... how can this method be implemented?


  
     Root
     0
     1000
    
      Root_1
       800
       1000
    
       Root_1_1
       801
       1000
         
          Root_1_1
           802
          1000
        
     
   
  

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.