input unknown number of fields into mysql - best structure for this?

别等时光非礼了梦想. 提交于 2019-12-02 04:43:58
e4c5

There is something in mysql 5.7 tailor made for this situation. The JSON type.

What you can do is convert your form to an associative array and then save that in the JSON field.

There are a few caveats though, this field though searchable isn't as efficient at searches as would a normal varchar column. Additionally if you want to use it in a join you are in deep trouble.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!