Read records from XML File [message #174372] |
Thu, 09 June 2011 09:28 |
Sarah
Messages: 30 Registered: December 2010
Karma: 0
|
Member |
|
|
Hi! I've an URL that returns me an XML file with this structure
<events>
<event>
<title>.dsfdsfd </title>
.....
Ho can I read each item and save in my local DB??
Thank for help me!
|
|
|
Re: Read records from XML File [message #174373 is a reply to message #174372] |
Thu, 09 June 2011 09:42 |
JohnT
Messages: 16 Registered: April 2011
Karma: 0
|
Junior Member |
|
|
On Thu, 09 Jun 2011 02:28:18 -0700, Sarah wrote:
> Hi! I've an URL that returns me an XML file with this structure
>
> <events>
> <event>
> <title>.dsfdsfd </title>
> ....
>
> Ho can I read each item and save in my local DB??
>
Two choices:
1) You can parse the XML file yourself.
You can use regular expressions to extract the data you want to put
into the DB
2) Use the php xml parser functions:
http://uk.php.net/manual/en/book.xml.php
The php xml functions are quite complicated to use, so for a simple XML
file, it may be easier to do it yourself.
Regards
JohnT
|
|
|
Re: Read records from XML File [message #174374 is a reply to message #174372] |
Thu, 09 June 2011 09:43 |
Michael Fesser
Messages: 215 Registered: September 2010
Karma: 0
|
Senior Member |
|
|
.oO(Sarah)
> Hi! I've an URL that returns me an XML file with this structure
>
> <events>
> <event>
> <title>.dsfdsfd </title>
> ....
>
> Ho can I read each item and save in my local DB??
SimpleXML?
Micha
|
|
|
|
Re: Read records from XML File [message #174382 is a reply to message #174378] |
Thu, 09 June 2011 13:54 |
Sarah
Messages: 30 Registered: December 2010
Karma: 0
|
Member |
|
|
Thanks to all!
Can you make a simple example using simplexml??
I like to know how to read items (and records) and for each record
reads. execute an insert in my DB!
Very thanks for help me!!!
|
|
|
|