0
值沒有被插入,也沒有顯示錯誤。任何想法,以我的插入發生了什麼?xml到mysql simplexml_load_string,沒有插入
<?php
$string = <<<XML
<?xml version='1.0'?>
<setnames>
<country>
<countryCode>AD</countryCode>
<countryName>Andorra</countryName>
</country>
<country>
<countryCode>AE</countryCode>
<countryName>United Arab Emirates</countryName>
<isoNumeric>784</isoNumeric>
</country>
<country>
<countryCode>AF</countryCode>
<countryName>Afghanistan</countryName>
<isoNumeric>784</isoNumeric>
</country>
</setnames>
XML;
$xml = simplexml_load_string($string);
foreach ($xml as $country)
{
mysqli INSERT INTO setnames
VALUES ($country->countryCode, $country->countryName, $country->isoNumeric);
echo $country->countryCode . "<br />";
echo $country->countryName . "<br />";
echo $country->isoNumeric . "<br />"
}
什麼顯示'var_dump($ xml)'? –