dounue6984 2018-01-25 08:41
浏览 19
已采纳

我应该在db-PHP和Mysql中为产品创建2个表吗?

I've got some question(s) How many tables should i create for my products ?

2???=products & products pics???

if yes then my mysql tables will be like that ? 1.products= p_id, p_name, p_descr, p_pieces, p_categ, p_subcateg(??) &

2.products_pics= pp_id, product_id, thumb, image, type (???)

Well im a little bit confused cause i think its not so necessary to use products_pics into the db anymore .

My product entries will be around 3.000 for the beginning . Can someone tell me what im going to write-do ??? Thank you very much !

  • 写回答

2条回答 默认 最新

  • doulan1073 2018-01-25 09:02
    关注

    You should make 3 tables

    • products
    • images
    • products_images

    In table products you have id_prod (primary key), name_prod, and other.

    In table images you have id_img (primary key), name_img or img_src.

    In table products_images you link images with products, and structure should be like id (primary), id_prod, id_img.

    This way you will not have a duplicate content in tables.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!