var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
I'm just curious about a particular design issue. I'll just talk about the 3 tables involved. The three tables are tblUsers, tblContent, and tblLogs.
Here's what I want to do:
1) tblUsers is related to tblContent because any content created should have a user associated with it (ie. author of the content)
2) tblLogs is related to tblUsers because I want to log any activity performed by any particular user
3) tblLogs is related to tblContent because I want to log any activity performed on any content by a particular user
Is this an example of a circular reference? Do I need to be concerned about this situation? If so, how do I fix it??
Thanks in advance
Re: Circular Reference?
It sounds like it will be OK, because the users have different roles in the relationships - the user who is the author of the content vs. the user who performed some other logged activity on the content.
As an aside, don't you think Users, Content and Logs would be better table names than tblUsers, tblContent and tblLogs? The "tbl" prefix does nothing useful, but makes the SQL harder to follow - IMHO
Thanks for your prompt reply!
The only reason I'm using 'tbl' is because a client wants me to follow their naming standards. I'm all for getting rid of the prefix.
I prefer to divide tblLogs into two tables, one for user activities unrelated to content such as login and logout, the other for user activities performed on content.
Following is my solution:
tblUsers (UserID PK, Name, ...);
tblContent (ContentID PK, Author FK, ...);
tblUserLogs (UserLogID PK, UserID FK, Activity, ...);
tblContentLogs (ContentLogID PK, UserID FK, ContentID FK, Activity, ...)