- Joined
- Sep 10, 2002
- Messages
- 5,834
- Reaction score
- 75
I search google but no success, not giving up yet!
I need to know best practice to auto-upload the xml feed I received from partners to my MySQL database.
Everyday, I received this XML file e.g. 'testdata.xml'. I add these xml values to the table manually everyday, I need to automate this process.
<?xml version="1.0" encoding="utf-8"?>
<elements>
<device>0-123456</device>
<unixTime>1034268516</unixTime>
<location>N</location>
<data length="9" source="pc" encoding="hex">0xC0560D72DA4AB2445A</data>
</elements>
I need to create a php script to open all xml files (1testdata.xml, 2testdata.xml, 3testdata.xml, etc)and insert these to my Mysql database table using the same field name .e.g device, unixtime, location, and data.
My initial assessment is to create a php script, to read the xml file, capture the xml data, then insert to my MySQL table. And set up a cron to run the script every hour.
Creating the php script to read the xml file, inserting the data to MySQL is where I'm stuck. Any idea where to begin?
Thank you,
em @ king.net
I need to know best practice to auto-upload the xml feed I received from partners to my MySQL database.
Everyday, I received this XML file e.g. 'testdata.xml'. I add these xml values to the table manually everyday, I need to automate this process.
<?xml version="1.0" encoding="utf-8"?>
<elements>
<device>0-123456</device>
<unixTime>1034268516</unixTime>
<location>N</location>
<data length="9" source="pc" encoding="hex">0xC0560D72DA4AB2445A</data>
</elements>
I need to create a php script to open all xml files (1testdata.xml, 2testdata.xml, 3testdata.xml, etc)and insert these to my Mysql database table using the same field name .e.g device, unixtime, location, and data.
My initial assessment is to create a php script, to read the xml file, capture the xml data, then insert to my MySQL table. And set up a cron to run the script every hour.
Creating the php script to read the xml file, inserting the data to MySQL is where I'm stuck. Any idea where to begin?
Thank you,
em @ king.net