用于存储动态表单数据的表结构
我们有一个表单生成器(Web)应用程序,允许用户动态设计表单。存储通过这些动态创建的表单提交的数据的最佳表结构是什么?
我在想 attribute_name 和 attribute_value 之类的东西?有没有更好的替代方案或建议可以使这两个列结构足够灵活?
We have a Form Builder (web) application which allows users to design their forms dynamically. What could be best table structure to store the data submitted through these dynamically created forms?
I am thinking of attribute_name and attribute_value kind of thing? Are there any better alternatives any suggestion to be flexible enough with these two column structure?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我肯定会看一下数据透视表:正如您所建议的,本质上您有一个表定义父对象中包含的列,另一个表为每个属性值包含单独的行。对于动态表单,当添加属性时,它们将成为数据库中的行,而不是列。希望这有帮助。
I would definitely take a look at Pivot Tables : as you suggest, essentially you have one table which defines the columns contained in a parent object, and another table with an individual row for each attribute value. For dynamic forms, then, as attributes are added, they become rows in a database, not columns. Hope this helps.