xml to mysql class
@param?
xml file name?
table name
the class need to read xml file and create a table like the xml file?
and copy all data from xml to db (with utf-8 char's)
?
sample :
mysql table
xml
First table is the main node list:
?
CREATE TABLE hk (
? ? ? ? ? autoindex INT ? NOT NULL AUTO_INCREMENT PRIMARY KEY,
? ? ? ? ? name VARCHAR(100),
tile VARCHAR(100),
? ? ? ? );
? ?
For every attribute need extra table with parent _id relation
?
CREATE TABLE sex (
? ? ? ? ? autoindex INT ? NOT NULL AUTO_INCREMENT PRIMARY KEY,
? ? ? ? ? parent_id int,
sex VARCHAR(100),
? ? ? ? ); ? ?
? ?
For every sub node need extra table with parent _id relation
?
CREATE TABLE title (
? ? ? ? ? autoindex INT ? NOT NULL AUTO_INCREMENT PRIMARY KEY,
? ? ? ? ? parent_id int,
sub_title1 VARCHAR(100),
? sub_title1 VARCHAR(100)
? ? ? ? ); ? ?
<hk>
? ? ? <name sex="male" >yaron</name>
? ? ? <id>123</id>
? ? ? <title>me
? ? ? ? ? <sub_tilte1>sub me</sub_title1>
? ? ? ? ? <sub_tilte2>sub me</sub_title2>
? ? ? </ title >
</hk>