How should I structure my settings table with MySQL?

后端 未结 4 1339
我在风中等你
我在风中等你 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

    As usual, it depends. Solution 1 is simpler. Sol #2 easily integrates with ORMs, but may hit DB row size limitations. Google for OTLT (as in One True Lookup Table problem) How much settings do you have(few? dozens? hundreds?) How often will you need them?

提交回复
热议问题