【发布时间】:2018-03-09 06:59:52
【问题描述】:
这是我的 XML 文件:
<?xml version="1.0" encoding="UTF-8"?>
<ProductData version="2.0">
<Product>
<code>1000001</code>
<name>The Name</name>
<brand>The Brand</brand>
<category>The Category</category>
<specification>
<characteristic>
<color>The Color</color>
<size>The Size</size>
</characteristic>
</specification>
<quantity>
<store1>0</store1>
<store2>4</store2>
<store3>5</store3>
<store4>2</store4>
<store5>3</store5>
</quantity>
</Product>
</ProductData>
如何在我的数据库中创建一个表并能够导入这些数据,因为我有超过 100 个<Product>,我不可能一个一个地放。
在我的数据库中也有必要不要包含一些字段,实际上我只需要代码和每个商店的数量。
你可以帮助我,我不知道如何创建数据库的结构,我不知道如何进行查询插入然后更新。
【问题讨论】:
-
请检查此示例“webslesson.info/2017/09/…”以获取 xml 到 phpmyadmin。
标签: php mysql xml phpmyadmin