获取xml数据并插入数据库

时间:2015-10-06 18:14:47

标签: mysql xml insert

如何将XML数据插入表格?

以下是我的XML数据:

SimpleXMLElement Object
(
    [songitem] => Array
        (
            [0] => SimpleXMLElement Object
                (
                    [@attributes] => Array
                        (
                            [song] => Elona
                            [album] => AL-F-001
                            [path] => link1
                            [calen] => 278
                            [dl] => d1
                        )

                )

            [1] => SimpleXMLElement Object
                (
                    [@attributes] => Array
                        (
                            [song] => Evis
                            [album] => AL-F-002
                            [path] => link2
                            [calen] => 279
                            [dl] => d2
                        )

                )

            [2] => SimpleXMLElement Object
                (
                    [@attributes] => Array
                        (
                            [song] => Kozeta
                            [album] => AL-F-003
                            [path] => link3
                            [calen] => 280
                            [dl] => d3
                        )

                )

        )

)

想要获得歌曲,专辑,路径等等。并插入表格。

0 个答案:

没有答案