PHP: XML to MySQL

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

    PHP: XML to MySQL

    I receive various XML files from clients for updating my MYSQL database.

    I've looked around, but can't find any program to generate PHP or SQL code
    for importing datas from XML to put in the MYSQL database.

    Can somebody tell me how to do so ????

    I've no idea on how to work with XML, and I'm sure such code generator
    exists. If not, please tell me where to start.

    Please help me !

    BoB


  • Mike

    #2
    Re: PHP: XML to MySQL

    Bob Bedford wrote:[color=blue]
    > I receive various XML files from clients for updating my MYSQL database.
    >
    > I've looked around, but can't find any program to generate PHP or SQL code
    > for importing datas from XML to put in the MYSQL database.
    >
    > Can somebody tell me how to do so ????
    >
    > I've no idea on how to work with XML, and I'm sure such code generator
    > exists. If not, please tell me where to start.[/color]

    Look at www.php.net for a couple of examples. They have some examples
    about how to use it with stylesheet and how to decode the data out of
    the cml data.
    [color=blue]
    >
    > Please help me !
    >
    > BoB
    >
    >[/color]

    Comment

    • Five Cats

      #3
      Re: PHP: XML to MySQL

      In message <40dc06bf$0$266 31$5402220f@new s.sunrise.ch>, Bob Bedford
      <bedford1@YouKn owWhatToDoHereh otmail.com> writes[color=blue]
      >I receive various XML files from clients for updating my MYSQL database.
      >
      >I've looked around, but can't find any program to generate PHP or SQL code
      >for importing datas from XML to put in the MYSQL database.
      >
      >Can somebody tell me how to do so ????
      >
      >I've no idea on how to work with XML, and I'm sure such code generator
      >exists. If not, please tell me where to start.
      >
      >Please help me ![/color]


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


      and read the examples given to illuminate.....

      Oddly we have just been doing something similar for an Open University
      course (using JBuilder) and what I found helpful (once I got to doing
      the assignment question) was to take a simple example which merely
      parsed an XML file and wrote out when elements were starting and ending.
      Then I started to understand what had to be put where to deal with it.

      I guess an alternative is an XSLT transformation to produce a .sql file
      from the XML which you can use to directly update your database... but
      I have no idea if there is an XSLT engine for PHP![color=blue]
      >[/color]

      --
      Five Cats
      Email to: cats_spam at uk2 dot net

      Comment

      • Tony Marston

        #4
        Re: PHP: XML to MySQL


        "Five Cats" <cats_spam@[127.0.0.1]> wrote in message
        news:hnndTgA6IB 3AFwVQ@[127.0.0.1]...[color=blue]
        > In message <40dc06bf$0$266 31$5402220f@new s.sunrise.ch>, Bob Bedford
        > <bedford1@YouKn owWhatToDoHereh otmail.com> writes[color=green]
        > >I receive various XML files from clients for updating my MYSQL database.
        > >
        > >I've looked around, but can't find any program to generate PHP or SQL[/color][/color]
        code[color=blue][color=green]
        > >for importing datas from XML to put in the MYSQL database.
        > >
        > >Can somebody tell me how to do so ????
        > >
        > >I've no idea on how to work with XML, and I'm sure such code generator
        > >exists. If not, please tell me where to start.
        > >
        > >Please help me ![/color]
        >
        >
        > http://uk.php.net/manual/en/ref.xml.php
        >
        > and read the examples given to illuminate.....
        >
        > Oddly we have just been doing something similar for an Open University
        > course (using JBuilder) and what I found helpful (once I got to doing
        > the assignment question) was to take a simple example which merely
        > parsed an XML file and wrote out when elements were starting and ending.
        > Then I started to understand what had to be put where to deal with it.
        >
        > I guess an alternative is an XSLT transformation to produce a .sql file
        > from the XML which you can use to directly update your database... but
        > I have no idea if there is an XSLT engine for PHP![/color]

        There is most definitely an XSLT engine for PHP. In PHP 4 this is the
        Sablotron extension which is described at


        --
        Tony Marston

        This is Tony Marston's web site, containing personal information plus pages devoted to the Uniface 4GL development language, XML and XSL, PHP and MySQL, and a bit of COBOL




        Comment

        • Five Cats

          #5
          Re: PHP: XML to MySQL

          In message <cbh7i9$f72$1$8 300dec7@news.de mon.co.uk>, Tony Marston
          <tony@NOSPAM.de mon.co.uk> writes[color=blue]
          >
          >"Five Cats" <cats_spam@[127.0.0.1]> wrote in message
          >news:hnndTgA6I B3AFwVQ@[127.0.0.1]...[color=green]
          >> In message <40dc06bf$0$266 31$5402220f@new s.sunrise.ch>, Bob Bedford
          >> <bedford1@YouKn owWhatToDoHereh otmail.com> writes[color=darkred]
          >> >I receive various XML files from clients for updating my MYSQL database.
          >> >
          >> >I've looked around, but can't find any program to generate PHP or SQL[/color][/color]
          >code[color=green][color=darkred]
          >> >for importing datas from XML to put in the MYSQL database.
          >> >
          >> >Can somebody tell me how to do so ????
          >> >
          >> >I've no idea on how to work with XML, and I'm sure such code generator
          >> >exists. If not, please tell me where to start.
          >> >
          >> >Please help me ![/color]
          >>
          >>
          >> http://uk.php.net/manual/en/ref.xml.php
          >>
          >> and read the examples given to illuminate.....
          >>
          >> Oddly we have just been doing something similar for an Open University
          >> course (using JBuilder) and what I found helpful (once I got to doing
          >> the assignment question) was to take a simple example which merely
          >> parsed an XML file and wrote out when elements were starting and ending.
          >> Then I started to understand what had to be put where to deal with it.
          >>
          >> I guess an alternative is an XSLT transformation to produce a .sql file
          >> from the XML which you can use to directly update your database... but
          >> I have no idea if there is an XSLT engine for PHP![/color]
          >
          >There is most definitely an XSLT engine for PHP. In PHP 4 this is the
          >Sablotron extension which is described at
          >http://www.tonymarston.co.uk/php-mysql/sablotron.html[/color]

          I thought there would be.... Now the OP just has to learn to write the
          XSLT stylesheets![color=blue]
          >[/color]

          --
          Five Cats
          Email to: cats_spam at uk2 dot net

          Comment

          Working...