<?php
mysql_connect("localhost", "root", "");
mysql_select_db("dbtrik5");
 
$dataxml = simplexml_load_file('databuku.xml');
 
foreach($dataxml->book as $buku)
{
   $id = $buku['id'];
   $author = $buku->author;
   $title = addslashes($buku->title);
   $genre = $buku->genre;
   $price = $buku->price;
   $publish_date = $buku->publish_date;
   $description = $buku->description;

   $query = "INSERT INTO book VALUES ('$id', '$author','$title', '$genre', '$price', '$publish_date', '$description') ";
   mysql_query($query);
} 
?>

