Best way to store an array in MySQL database?

后端 未结 3 1716
没有蜡笔的小新
没有蜡笔的小新 2020-12-30 23:52

Part of my app includes volume automation for songs.

The volume automation is described in the following format:

[[0,50],[20,62],[48,92]] 

3条回答
  •  北荒
    北荒 (楼主)
    2020-12-31 00:13

    I suggest you to take a look at the JSON data type. This way you can store your array in a more efficient way than text or varchar, and you can access your data directly form MySQL without having to parse the whole thing.

    Take a look at this link : https://dev.mysql.com/doc/refman/5.7/en/json.html

提交回复
热议问题