Advertisement

05.16.2008 at 04:12AM PDT, ID: 23407883 | Points: 500
[x]
Attachment Details

Process XML with PHP and store in MySQL

Asked by djclarkson in PHP and Databases

I want to process an XML file and store the results in a mysql database. I will later do reports on the data. What is the best table structure for mysql? A table for objects and events? How do I process this log (there are hundreds of objects and hundreds of events) and store it to mysql?

I previously did a bit of work with PHP, so I know how to do the basics only.

So I have an XML file. Below is a truncated example:

<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<TacviewDebriefing Version="0.90">
      <!--General Flight Data-->
      <Flight>
            <StartTime>21000.00</StartTime>
            <Duration>12243.05</Duration>
      </Flight>
      <!--Active Objects List-->
      <Objects>            
                            <Object ID="5219">
                  <Type>Missile</Type>
                  <Name>9M38M1 Buk-M1 (SA-11 Gadfly)</Name>
                  <Coalition>Enemies</Coalition>
                  <Parent ID="45" />
            </Object>
      </Objects>
      <!--Flight Log-->
      <Events>
            <Event>
                  <Time>1957.36</Time>
                  <Object ID="276" />
                  <Action>HasTakeOff</Action>
                  <Airport ID="ICAO:UGSS">
                        <Name>Sukhumi-Babusheri Airport</Name>
                  </Airport>
                           </Event>
             </Evemts>Start Free Trial
[+][-]05.19.2008 at 06:43PM PDT, ID: 21602982

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.19.2008 at 06:51PM PDT, ID: 21603013

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.20.2008 at 08:38AM PDT, ID: 21607215

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.22.2008 at 12:23AM PDT, ID: 21621554

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.22.2008 at 12:41AM PDT, ID: 21621610

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.22.2008 at 05:13AM PDT, ID: 21622985

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.25.2008 at 02:53PM PDT, ID: 21643752

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628