Working with PHP, XML, MySQL

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Aggelos

    Working with PHP, XML, MySQL

    Hello,
    I am having an XML file that contains booking details. These booking
    details are supposed to get gennerated from a booking application.
    I then need to build a system that will process those XML files and
    store them inside a MySQL DB using PHP.
    Is there any standard methodology to do such thing ?

    IS there a class I should use to make my life easier?
    The ideal situation would be to somehow achieve storing the XML
    elements inside a multidimensiona l array and then insert them in the
    DB...

    Can you point me in the right direction please ? I 've never dealt
    with XML parsing.

    Thanks in advance.

  • Andrew Taylor

    #2
    Re: Working with PHP, XML, MySQL

    On 2007-03-02 10:43:55 +0000, "Aggelos" <djjelly@gmail. comsaid:
    Hello,
    I am having an XML file that contains booking details. These booking
    details are supposed to get gennerated from a booking application.
    I then need to build a system that will process those XML files and
    store them inside a MySQL DB using PHP.
    Is there any standard methodology to do such thing ?
    >
    IS there a class I should use to make my life easier?
    The ideal situation would be to somehow achieve storing the XML
    elements inside a multidimensiona l array and then insert them in the
    DB...
    >
    Can you point me in the right direction please ? I 've never dealt
    with XML parsing.





    Hope this helps

    Andrew

    Comment

    • Aggelos

      #3
      Re: Working with PHP, XML, MySQL

      On Mar 2, 1:40 pm, Andrew Taylor wrote:
      On 2007-03-02 10:43:55 +0000, "Aggelos" <djje...@gmail. comsaid:
      >
      Hello,
      I am having an XML file that contains booking details. These booking
      details are supposed to get gennerated from a booking application.
      I then need to build a system that will process those XML files and
      store them inside a MySQL DB using PHP.
      Is there any standard methodology to do such thing ?
      >
      IS there a class I should use to make my life easier?
      The ideal situation would be to somehow achieve storing the XML
      elements inside a multidimensiona l array and then insert them in the
      DB...
      >
      Can you point me in the right direction please ? I 've never dealt
      with XML parsing.
      >

      >

      >
      Hope this helps
      >
      Andrew
      That requires PHP5 :S is there something for PHP4 ?

      Comment

      • NC

        #4
        Re: Working with PHP, XML, MySQL

        On Mar 2, 2:43 am, "Aggelos" <djje...@gmail. comwrote:
        >
        I am having an XML file that contains booking details. These booking
        details are supposed to get gennerated from a booking application.
        I then need to build a system that will process those XML files and
        store them inside a MySQL DB using PHP.
        Is there any standard methodology to do such thing ?
        No. There are many PHP extensions that can be used to parse XML.
        Since you mentioned later in the thread that you are using PHP 4,
        here are two extensions that work with PHP 4:


        PHP is a popular general-purpose scripting language that powers everything from your blog to the most popular websites in the world.


        Cheers,
        NC

        Comment

        • Aggelos

          #5
          Re: Working with PHP, XML, MySQL

          On Mar 2, 3:22 pm, "NC" <n...@iname.com wrote:
          On Mar 2, 2:43 am, "Aggelos" <djje...@gmail. comwrote:
          >
          >
          >
          I am having an XML file that contains booking details. These booking
          details are supposed to get gennerated from a booking application.
          I then need to build a system that will process those XML files and
          store them inside a MySQL DB using PHP.
          Is there any standard methodology to do such thing ?
          >
          No. There are many PHP extensions that can be used to parse XML.
          Since you mentioned later in the thread that you are using PHP 4,
          here are two extensions that work with PHP 4:
          >
          PHP is a popular general-purpose scripting language that powers everything from your blog to the most popular websites in the world.

          >
          Cheers,
          NC
          I've used miniXML which works quite well, but I am getting some weird
          NOTICES
          Notice: Only variable references should be returned by reference in /
          PATH/TO/DIR/miniXml/classes/element.inc.php on line 610

          :s
          but i still have some problems as the XML structure has multiple
          elements with the same name but different attributes

          e.g.
          + <Supplier>
          + <Originator>
          + <PassengerDetai l p="1">
          + <PassengerDetai l p="2">
          + <PassengerDetai l p="3">

          and I don't know how to put these an array

          array[PassengerDetail][1]
          array[PassengerDetail][2]
          array[PassengerDetail][3]

          thank you.

          Comment

          Working...