search

Home  >  Q&A  >  body text

php - How to design a database similar to the top three levels of navigation on Apple’s official website?

Mac/iPad/iPhone...First-level navigation

iPad Pro/ipad/iOS 10...Secondary Navigation

Overview/Technical Specifications/Buy Button...Three Level Navigation

How should the database be designed? How are the PHP code layers assembled?

習慣沉默習慣沉默2780 days ago1210

reply all(2)I'll reply

  • 滿天的星座

    滿天的星座2017-05-27 17:41:14

    Create a product category table and a model table information table.
    Mac/iPad/iPhone...the first-level navigation is stored in the product category table
    iPad Pro/ipad/iOS 10...the second-level navigation is stored in the model information table

    When querying, you only need to query the category as the first-level navigation.
    Query the model information table as the second-level navigation and information.

    reply
    0
  • PHPz

    PHPz2017-05-27 17:41:14

    Thanks for the invitation!

    If you just want to deal with the correspondence between level 1, 2, and 3 categories, you only need one table, and add two fields parent_id (parent class ID) and child_id (child class ID) to the table

    reply
    0
  • Cancelreply