473,396 Members | 1,997 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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
Jul 17 '05 #1
4 2242
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
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

"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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Andres Rosado-Sepulveda | last post by:
Hello, I'm having trouble compiling PHP 4.3.4 on Solaris 8. This is the error message it is showing: -- start -- Undefined first referenced symbol ...
4
by: nandyal | last post by:
All, The following script works as intended in MS-Windows and in other Linux boxes, except on the one that runs php 4.3.10. Sorry for the long post. 1) # uname -a Linux bubba 2.4.20 #5 SMP...
3
by: Chris Paul | last post by:
I'm having trouble with PHP & PostgreSQL/OpenLDAP/Apache on Windows. I've set this up countless times on BSD (piece of cake) but I'm trying to do this on Windows now so that my developer can work...
1
by: laredotornado | last post by:
Hi, I'm using PHP 4.4.4 on Apache 2 on Fedora Core 5. PHP was installed using Apache's apxs and the php library was installed to /usr/local/php. However, when I set my "error_reporting"...
14
by: mistral | last post by:
Need php script to create mySQL database programmatically; since hosting configuration may not allow create database from script, script also need eliminate/rewrite all restrictions in appropriate...
8
by: eholz1 | last post by:
Hello Newsgroup, I have redhat 3.0 Enterprise, and mysql (3.58.xxx more or less) installed from a redhat rpm, and php 4.3.9 (installed from an rpm) - I can access data from my mysql db using php...
3
by: drblitzkrieg | last post by:
Hi, A bit of a newbie as far as mysql and php adminning I am; I upgraded php to version 4.4.6, and mysql to 4.1.22, following the instructions in the "INSTALL" files of each (I also have the...
2
by: gvijayasurya | last post by:
11. What are the different tables present in mysql, which type of table is generated when we are creating a table in the following syntax: create table employee(eno int(2),ename varchar(10)) ? 12....
221
Atli
by: Atli | last post by:
You may be wondering why you would want to put your files “into” the database, rather than just onto the file-system. Well, most of the time, you wouldn’t. In situations where your PHP application...
39
by: alex | last post by:
I've converted a latin1 database I have to utf8. The process has been: # mysqldump -u root -p --default-character-set=latin1 -c --insert-ignore --skip-set-charset mydb mydb.sql # iconv -f...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.