We help IT Professionals succeed at work.
Get Started

PHP Script to import XML File

softbless
softbless asked
on
292 Views
Last Modified: 2013-12-12
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

Comment
Watch Question
Freelancer
CERTIFIED EXPERT
Top Expert 2010
Commented:
This problem has been solved!
Unlock 1 Answer and 2 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE