【发布时间】:2012-03-07 03:31:07
【问题描述】:
我正在为可能有数百名用户的教师开发一个 web 应用程序,每个用户可能会创建十个左右的模板,其中包含十个左右的部分和十个左右的主题,每个主题都有一个长短版本的文本。
这将产生一个像这样的多维数组:
[userID][templates][1][name] // template 1 name
[userID][templates][1][1][name] // template 1 section 1 name
[userID][templates][1][1][1][name] // template 1 section 1 topic 1 name
[userID][templates][1][1][1][1][short] // template 1 section 1 topic 1 option 1 short
[userID][templates][1][1][1][1][long] // template 1 section 1 topic 1 option 1 long
每个数字可能不同(最多约 10 个)。 'name' 元素仅代表用户友好的名称。
模板元素之外可能还有一些其他设置。 只需要存储和检索文本。存储和检索此数据的最简单方法是什么。我需要创建数千个 mySQL 表(是不是太多了?我只用过最多 5 个)还是有更直接的方法?
【问题讨论】:
-
显然每个用户加载整个数组是没有意义的,因为它包含所有用户的设置
标签: php mysql database settings