PDA

View Full Version : WAAAHHH!!! Need PHP+XML help :(



ya3
July 19th, 2007, 11:29 AM
I've looked at several tutorials including the Kirupa ones, but it's still doing my head in, and I honestly don't have that much time to spend learning this PHP+XML business for this particular job...

This is a sample of the XML I will be using:
http://www.xe.com/dfs/sample-usd.xml

It contains exchange rates... They are contained within the <currency> tags. I basically just need to extract the <csymbol> and <crate> of a few different currencies (and subsequently dump them into a very simple MySQL db with two fields).

So... Say I needed the script to extract the exchange rates for GBP, NZD and CAD... Could someone please hold my hand and show me how to do it? :P

btw, I'm using PHP 4, so I can't use any of those wonderful simplexml functions :(

Thanks in advance!!!

icio
July 19th, 2007, 11:35 AM
I'll take a look when I get back from work if you're needing a hand (assuming nobody else has chipped in). I'll get back in a few hours :thumb:

icio
July 19th, 2007, 07:10 PM
Ah! I forgot all about this because my flatmate for crackdown and we were playing co-op. Really sorry about that!

ya3
July 19th, 2007, 09:34 PM
hah, thats fine :P Whenever you get time, that would be awesome...

EDIT: WOOOOOOOOOOOOOOOO, ok, scrap that. I got it working. I ditched XML altogether and opted for the CSV format instead. Now it's just a matter of using this wonderful script:
http://legend.ws/blog/tips-tricks/csv-php-mysql-import/
to automagically dump the CSV into my MySQL db :) Works beautifully.