2
的mysql我必須從XML到數據庫中插入數據,但我有這個特定數據的問題插入XML數據,用SimpleXML
<specifications>
<attribute_group name="attributeGroup1">
<attribute name="attribute1">
<value>value1</value>
</attribute>
<attribute name="attribute2">
<value>value2</value>
</attribute>
<attribute name="attribute3">
<value>value3</value>
</attribute>
</attribute_group>
<specifications>
我需要插入到數據庫類似
INSERT INTO specs (attr_group,attr_name, attr_value) VALUES ('$attr_group','$attr_name', '$attr_value')
問題是我不知道如何爲此創建foreach。
你有一個錯字:爲'規格>' – Ghost 2014-08-29 08:05:01
是,錯字:)謝謝沒有結束標籤。 – gandrap 2014-08-29 08:54:30