0
我需要使用PHP將XML內容插入到mysql數據庫中。簡單的XML導入我已經完成了。但是這個XML包含許多嵌套節點。 我對如何處理這個問題感到非常困惑。 所以請幫我插入內容。如何使用PHP將XML內容插入到mysql數據庫
這裏是我的XML
<?xml version="1.0" encoding="UTF-8"?>
<properties>
<pagination xmlns:xlink="http://www.w3.org/1999/xlink">
<current_page rel="current_page">1</current_page>
<per_page record_type="integer">50</per_page>
<total_entries record_type="integer">1</total_entries>
<total_pages record_type="integer">1</total_pages>
</pagination>
<property>
<id>1344982</id>
<unique_id></unique_id>
<xml_id></xml_id>
<third_contact_id>128555</third_contact_id>
<headline>Test DiY</headline>
<description>fghfd hdfgh fgh</description>
<country>Australia</country>
<deal_type></deal_type>
<display_address>1</display_address>
<display_price>1</display_price>
<display_price_text></display_price_text>
<latitude>-25.274398</latitude>
<longitude>133.775136</longitude>
<price>15082</price>
<to_price>16000</to_price>
<property_type>Warehouse</property_type>
<save_status>Submitted</save_status>
<state>NSW</state>
<status>available</status>
<street_number>12/22 </street_number>
<street>fasdfa sdf</street>
<suburb>MOUNT AUSTIN</suburb>
<town_village>Riverina</town_village>
<unit_number>1</unit_number>
<vendor_email></vendor_email>
<vendor_first_name></vendor_first_name>
<vendor_last_name></vendor_last_name>
<vendor_phone></vendor_phone>
<zipcode>2650</zipcode>
<sold_on></sold_on>
<sold_price></sold_price>
<leased_on></leased_on>
<leased_price></leased_price>
<agent_id>12566</agent_id>
<office_id>13275</office_id>
<type>ResidentialSale</type>
<show_price></show_price>
<rca_id></rca_id>
<rea_unique_id></rea_unique_id>
<domain_id></domain_id>
<detail>
<auction-date nil="true"></auction-date>
<auction-place></auction-place>
<auction-price nil="true"></auction-price>
<auction-time nil="true"></auction-time>
<bathrooms>2</bathrooms>
<bedrooms>4</bedrooms>
<builder-name nil="true"></builder-name>
<capital-growth></capital-growth>
<carport-spaces>1</carport-spaces>
<closing-date nil="true"></closing-date>
<condo-strata-fee nil="true"></condo-strata-fee>
<condo-strata-fee-period></condo-strata-fee-period>
<energy-efficiency-rating>0.5</energy-efficiency-rating>
<estimate-rental-return nil="true"></estimate-rental-return>
<estimate-rental-return-period></estimate-rental-return-period>
<ext-link-1></ext-link-1>
<ext-link-2></ext-link-2>
<floor-area>480</floor-area>
<floor-area-metric></floor-area-metric>
<forthcoming-auction>false</forthcoming-auction>
<garage-spaces>1</garage-spaces>
<half-bathroom>true</half-bathroom>
<half-bedroom>true</half-bedroom>
<id>780069</id>
<land-area>0.80</land-area>
<land-area-metric>Acres</land-area-metric>
<land-crossover></land-crossover>
<land-depth-left>50.0</land-depth-left>
<land-depth-left-metric>Feet</land-depth-left-metric>
<land-depth-rear nil="true"></land-depth-rear>
<land-depth-rear-metric></land-depth-rear-metric>
<land-depth-right>50.0</land-depth-right>
<land-depth-right-metric>Feet</land-depth-right-metric>
<land-frontage>100.0</land-frontage>
<land-frontage-metric nil="true"></land-frontage-metric>
<living-area nil="true"></living-area>
<living-area-metric nil="true"></living-area-metric>
<method-of-sale nil="true"></method-of-sale>
<new-construction>false</new-construction>
<number-of-floors>1</number-of-floors>
<off-street-spaces>1</off-street-spaces>
<property-url></property-url>
<rental-yield></rental-yield>
<residential-sale-id>1344982</residential-sale-id>
<tax-rate nil="true"></tax-rate>
<tax-rate-period></tax-rate-period>
<virtual-tour></virtual-tour>
<water-rate nil="true"></water-rate>
<water-rate-period></water-rate-period>
<year-built nil="true"></year-built>
</detail>
<features>
<feature>
<name>Entertainment Area</name>
</feature>
<feature>
<name>Gym</name>
</feature>
<feature>
<name>Safe</name>
</feature>
</features>
<primary-contact>
<first-name>Josh </first-name>
<id>128555</id>
<last-name>Tonkes</last-name>
</primary-contact>
<secondary-contact>
<first-name>Josh </first-name>
<id>128555</id>
<last-name>Tonkes</last-name>
</secondary-contact>
<vendor-details>
<description></description>
<email>[email protected]</email>
<fax></fax>
<first-name>Josh </first-name>
<group>Sales Agent</group>
<id>128555</id>
<im-username nil="true"></im-username>
<last-name>Tonkes</last-name>
<login>[email protected]</login>
<mobile></mobile>
<office-id>13275</office-id>
<phone></phone>
</vendor-details>
<photos>
<photo position="0">
<large>http://img.agentaccount.com/5a60a25faa272cef83d0e2b369c5363acad8922a</large>
<medium>http://img.agentaccount.com/bd6492caa582b85c1fa921acaba37600f613dfa0</medium>
<thumb>http://img.agentaccount.com/de6512a4afb33e7ebf9b6159d15b5b0392125eb8</thumb>
<original>http://img.agentaccount.com/ddefad55c562ad7568525a2144869062e70fee29</original>
</photo>
</photos>
<floorplans>
</floorplans>
<brochures>
<brochure position="0">
<title></title>
<large></large>
</brochure>
<brochure position="1">
<title></title>
<large></large>
</brochure>
<brochure position="2">
<title></title>
<large></large>
</brochure>
<brochure position="3">
<title></title>
<large></large>
</brochure>
</brochures>
<audio></audio>
<property_videos>
</property_videos>
<updated_at>2013-12-14 11:49:39 +1100</updated_at>
<created_at>2013-12-14 11:47:14 +1100</created_at>
</property>
</properties>
在此先感謝..