使用php 5.0将xml上传到Mysql数据库

时间:2012-06-06 20:39:50

标签: php mysql xml

我有一个xml如下 -

<?xml version="1.0" encoding="UTF-8"?>
<result>
<item>
    <mid>2557</mid>
    <merchantname>DVD Players</merchantname>
    <linkid>1000012</linkid>
    <createdon>2006-09-30/20:04:17</createdon>
    <sku> JR-E-12324</sku>
    <productname>Sony Blu-Ray DVD Player</productname>
    <category>
        <primary>Electronics</primary>
        <secondary>TV . Video</secondary>
    </category>
    <price currency="JPY">59704</price>
    <upccode>4901340995017</upccode>
    <description>
        <short>Awesome Pictures</short>
        <long>Watch all your HD-DVDs</long>
    </description>
    <keywords>DVD Player~~BluRay~~SONY</keywords>
    <linkurl>http://somelink.com</linkurl>
    <imageurl>image.gif</imgurl>
</item>

我需要将上面的xml上传到mysql表中。有人可以帮忙吗?谢谢

1 个答案:

答案 0 :(得分:1)