473,386 Members | 1,823 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,386 software developers and data experts.

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 multidimensional 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.

Mar 2 '07 #1
4 2318
On 2007-03-02 10:43:55 +0000, "Aggelos" <dj*****@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 multidimensional array and then insert them in the
DB...

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

http://www.php.net/xml

http://www.php.net/SimpleXML

Hope this helps

Andrew

Mar 2 '07 #2
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 multidimensional array and then insert them in the
DB...
Can you point me in the right direction please ? I 've never dealt
with XML parsing.

http://www.php.net/xml

http://www.php.net/SimpleXML

Hope this helps

Andrew
That requires PHP5 :S is there something for PHP4 ?

Mar 2 '07 #3
NC
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:

http://www.php.net/XML
http://www.php.net/DOMXML

Cheers,
NC

Mar 2 '07 #4
On Mar 2, 3:22 pm, "NC" <n...@iname.comwrote:
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:

http://www.php.net/XMLhttp://www.php.net/DOMXML

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>
+ <PassengerDetail p="1">
+ <PassengerDetail p="2">
+ <PassengerDetail p="3">

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

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

thank you.

Mar 2 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Morten Gulbrandsen | last post by:
Database mysql running on localhost Error The additional Features for working with linked Tables have been deactivated. To find out why click here. -> Database mysql running on localhost ...
0
by: Lekeas GK | last post by:
Hi All, I am managing a small database and some of the tables need to be strings of an average length of about 2,000 characters. I decided to use the text datatype to store this information...
0
by: Hans Maurer | last post by:
>Description: We're running our current TTS application with MySQL (on Unix). All database, table and column names are in lower-case. However, we need to access this database with a new...
5
by: Andrew DeFaria | last post by:
I created the following .sql file to demonstrate a problem I'm having. According to the manual: If |ON DELETE CASCADE| is specified, and a row in the parent table is deleted, then InnoDB...
0
by: Robert Mazur | last post by:
MySQL 5.0 alpha (binary install) on Solaris 9 -or- RedHat 8.0 mysql-connector-java-3.0.8-stable ----------------------- Should I expect to be able to connect to MySQL5.0 alpha with JDBC?...
5
by: HydroSan | last post by:
Having a bit of a problem getting UPDATE working. The project in question is a simple MySQL VB.NET frontend, allowing Insertion, Selection, and others. Well, I've gotten Drop and Insert working,...
7
by: Paul | last post by:
I recently installed php 4.4.4 using windows binaries on Windows XP Pro. I also installed MySQL 4.1. I usually use Pear DB but I tried MDB2 and it worked fine until a client uses a different...
1
by: Paul | last post by:
I recently upgraded from MySQL 3.23 to 4.1. Now db is not working properly. I'd very much like your help in solving this issue! Here's the code I used to test it: require_once 'DB.php'; $db...
0
by: beary | last post by:
After months of using mysql, i decided i should have it on my local machine to make testing easier. So I downloaded and installed the latest version from the mysql site (mysql-5.0.37-win32.zip). It...
31
by: ajos | last post by:
hi frnds, i have a form,which has 2 input text boxes, the values are entering the text boxes,when i leave the 2 text boxes blank and hit submit a java script gives the message that the 2 fields are...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.