请原谅我缺乏知识......我知道互联网上有很多与此相关的文档,但我仍然不明白.
我的情况是这样的:
我有一个XML文件,我需要导入并最终每天更换.
<item>
<model>AA311-Pink</model>
<title>1122</title>
<price>19.43</price>
<category>cat</category>
<loc>/AA311.html</loc>
<image>/aa311.jpg</image>
<description>Item Info</description>
<weight>0.45</weight>
<option_type>Color-Color</option_type>
<option_value>Pink-Pink</option_value>
<suggested_retail>51.50</suggested_retail>
<special_handling/>
<manufacturer>Tantus</manufacturer>
<manufacturer_code>VB5074 and VB5067</manufacturer_code>
<packaging>Retail Packaging</packaging>
<in_stock>Yes</in_stock>
<lastupdated>2008-11-05 16:35:56</lastupdated>
Run Code Online (Sandbox Code Playgroud)
我需要自动更改一些列名,并将它们导入到我的数据库中的多个表中.
例如,
<item>
<products_model>AA315</products_model>
<products_name>name</products_name>
<price>19.43</price>
<category>cat</category>
<loc>/AA315.html</loc>
<products_image>aa315.jpg</products_image>
<products_description>info</products_description>
<products_weight>0.44</products_weight>
<option_type/>
<option_value/>
<products_price>51.50</products_price>
<special_handling/>
<manufactures_name>Tantus</manufactures_name>
<manufacturer_code>VA5104</manufacturer_code>
<packaging>Retail Packaging</packaging>
<products_status>Yes</products_status>
<products_last_modified>2008-11-05 16:35:27</products_last_modified>
Run Code Online (Sandbox Code Playgroud)
然后导入MySQL DB
列:products_weight,products_model,products_image,products_price,products_last_modified
导入表'产品'
列:products_description,products_name
导入表'product_description
那么自动创建的product_id呢?我可以发送表结构的SQL输出.
我真的很乐意帮助......如果他们愿意创建一个完全自动化的程序将这个文件导入我的数据库,我愿意支付一些费用.我正在使用Zen Cart来托管我的购物车.