Link to home
Start Free TrialLog in
Avatar of softbless
softbless

asked on

PHP Script to import XML File

Hi Guys,

I need PHP script that :
# There is a form to upload an XML file
# After that importing that XML to a table in MySQL
# Show success message when it's done importing the XML file, and give error message when it's failed to import

To help you setting the table, I give you the SQL script to create the table, and I also attach XML file sample.
 sample.xml

Please help. Thanks
/*
SQLyog Community Edition- MySQL GUI v7.11 
MySQL - 5.0.67-community : Database - sementara
*********************************************************************
*/


/*!40101 SET NAMES utf8 */;

/*!40101 SET SQL_MODE=''*/;

/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;

CREATE DATABASE /*!32312 IF NOT EXISTS*/`temporary` /*!40100 DEFAULT CHARACTER SET latin1 */;

/*Table structure for table `catalog` */

DROP TABLE IF EXISTS `catalog`;

CREATE TABLE `catalog` (
  `File_Name` varchar(1000) default NULL,
  `Category` varchar(1000) default NULL,
  `modified_date` varchar(1000) default NULL,
  `location` varchar(1000) default NULL,
  `size` varchar(1000) default NULL,
  `Content_type` varchar(1000) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

/*Data for the table `catalog` */

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Marco Gasi
Marco Gasi
Flag of Spain image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of softbless
softbless

ASKER

Thanks for helping