How should I structure my settings table with MySQL?

后端 未结 4 1479
我在风中等你
我在风中等你 2021-02-18 12:35

What\'s the best way to structure a MySQL table for storing admin settings?

Like this?

Setting _|_ Value
setting1 |   a
setting2 |   b
setting3 |   c
set         


        
4条回答
  •  轮回少年
    2021-02-18 13:36

    Your first example, name-value pairs or EAV, allows for a good deal more flexibility.

    Check out the wiki page about EAV modelling in databases.

提交回复
热议问题