PHP添加产品的有关问题,请大家帮帮忙

WBOY
Release: 2016-06-13 13:25:09
Original
920 people have browsed it

PHP添加产品的问题,请大家帮帮忙
产品表,Pro

字段:ID,ProName,Price

我现在要添加一件商品,比如:

衬衫,它的尺寸有M,L,XL,XXL, 颜色有:白,红,黑。

现在的问题是:这件商品的M码,只有白色和红色。
  这件商品的XL码,只有红色。
  这件商品的XXL码,有白,红,黑色。
怎么办啊。怎么添加啊。

而且这些都是不固定的,比如第二件商品,它的XL码,就不像第一件商品那样只是红色的,可能还有其他颜色的。

这些东西我要怎么做,请大家帮帮忙。

------解决方案--------------------

探讨
引用:
我觉得应该建几张表,分别为产品表,尺码表,颜色表,产品与颜色对应表,产品与尺码对应表,这样会更灵活

我就建了尺码表,颜色表,分别填写了所有的尺码和所有的颜色,
在添加第一个商品的时候,比如有四个尺码,M,L,XL,XXL,和三个颜色,怎么添加?
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!