Re: XML data extraction
| From: | Peter Ford | Date: | Thu, 02 Apr 2009 09:10:46 +0000 |
| Subject: | Re: XML data extraction | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-290949@lists.php.net to get a copy of this message | ||
Andrew Williams wrote:
> Best All,
>
> How can you best and accurately extract XLM data to DB table. e.g.:
>
> <EXCHANGE_LIST AMOUNT="3">
> -
> <EXCHANGE>
> <ID_EXCHANGE>20</ID_EXCHANGE>
> <CODE_EXCHANGE>FRA</CODE_EXCHANGE>
> <NAME_EXCHANGE>Frankfurt</NAME_EXCHANGE>
> </EXCHANGE>
> -
> <EXCHANGE>
> <ID_EXCHANGE>28</ID_EXCHANGE>
> <CODE_EXCHANGE>LSE</CODE_EXCHANGE>
> <NAME_EXCHANGE>London Stock Exchange</NAME_EXCHANGE>
> </EXCHANGE>
> -
> <EXCHANGE>
> <ID_EXCHANGE>226</ID_EXCHANGE>
> <CODE_EXCHANGE>GER</CODE_EXCHANGE>
> <NAME_EXCHANGE>Xetra</NAME_EXCHANGE>
> </EXCHANGE>
> </EXCHANGE_LIST>
>
> www.willandy.co.uk
>
Write some code to read the XML file. (you could at simpleXML, or
DOMDocument-based stuff)
Write some code to write the database statements. (probably some SQL, depends on
your database)
Run the database statements. (mysql_query, pg_query, whatever)
This is a very vague question, and this list is not normally well disposed to
writing people's programs for them, especially when they look like college
assignments.
Cheers
Pete
--
Peter Ford phone: 01580 893333
Developer fax: 01580 893399
Justcroft International Ltd., Staplehurst, Kent