Saturday 6 July 2013

XML TO PHPMYADMIN DATA INSERT THROUGH PHP

<?php
include_once('conf/conf.php');
?>
<?php
$xml=simplexml_load_file("CityList.xml");
foreach($xml as $child)
  {
  mysql_query("INSERT INTO `tr_in_city`set CityCode='$child->CityCode',CityName='$child->CityName',CountryCode='$child->CountryCode'") or die("not inserted");
  }
?>

No comments:

Post a Comment