开发者

Database Design with a flat considering time

Background: School counselors will login and make comments about their meetings with students.

Is开发者_开发技巧sues: PHP 4 server Flat File or CSV

Suppose I have HTML form with the following text fields user id date comments

How can I create an effective record keeping to be able to display the comments that have been made and next to them the date that they were made.


Without having more information this is my first shot. I focused on the database design aspect of your question since that is what it is tagged as. If you want to know how it should be displayed in a PHP app that seems like another question.

Student
-------
ID
FName
LName
{Other Student Info}

Counselor
---------
ID
FName
LName

Meeting
-------
ID
StudentId
CounselorId
Date

MeetingComment
-------
MeetingId
Comment

With this structure your query would look like the one below to select all comments and their date for one student.

SELECT  mc.Comment, m.Date
FROM    MeetingComment as mc
INNER JOIN Meeting as m
ON      mc.MeetingId = m.MeetingId
WHERE   m.StudentId = 1234
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜