我就此进行了很多讨论。 我只想征求你对此的建议。 基本上,我使用的是PHP和MySQL。 页: 1 表格:
users
------------------------------
uid(pk) | username | password
------------------------------
12 | user1 | hashedpw
------------------------------
供用户更新的表格
updates
--------------------------------------------
uid | date | content
--------------------------------------------
12 | 2011-11-17 08:21:01 | updated profile
12 | 2011-11-17 11:42:01 | created group
--------------------------------------------
用户简介页面将显示用户最新5次。 问题是:
- For the
updates
table, would it be possible to set both uid and date as composite primary keys with uid referencing uid fromusers
- OR would it be better to just create another column in
updates
which auto-increments and will be used as the primary key (while uid will be FK to uid inusers
)?