By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,521 Members | 1,460 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,521 IT Pros & Developers. It's quick & easy.

PHP: XML to MySQL

P: n/a
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
Jul 17 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Bob Bedford wrote:
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.
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.

Please help me !

BoB

Jul 17 '05 #2

P: n/a
In message <40***********************@news.sunrise.ch>, Bob Bedford
<be******@YouKnowWhatToDoHerehotmail.com> writes
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 !

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!


--
Five Cats
Email to: cats_spam at uk2 dot net
Jul 17 '05 #3

P: n/a

"Five Cats" <ca*******@[127.0.0.1]> wrote in message
news:hn**************@[127.0.0.1]...
In message <40***********************@news.sunrise.ch>, Bob Bedford
<be******@YouKnowWhatToDoHerehotmail.com> writes
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 codefor 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 !

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!


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

--
Tony Marston

http://www.tonymarston.net

Jul 17 '05 #4

P: n/a
In message <cb*******************@news.demon.co.uk>, Tony Marston
<to**@NOSPAM.demon.co.uk> writes

"Five Cats" <ca*******@[127.0.0.1]> wrote in message
news:hn**************@[127.0.0.1]...
In message <40***********************@news.sunrise.ch>, Bob Bedford
<be******@YouKnowWhatToDoHerehotmail.com> writes
>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 SQLcode >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 !

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!


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


I thought there would be.... Now the OP just has to learn to write the
XSLT stylesheets!


--
Five Cats
Email to: cats_spam at uk2 dot net
Jul 17 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.