views:

14

answers:

1

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

Issues: 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.

A: 

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
Abe Miessler
this is how I end up doing it. Your aproach is good if I had access to a database.
When the form was submitted a new txt file is created if it doesnt exist detailing the date and comment about the student. The reason for this is so that in the future we can query results using php based on dates. Again, if I did not create a txt file for each unique id, how can I put 2 entries of a student without damaging the uniqueness of the id.Simultaneously, I created another file that would input the user comments and the date fputs using php. Which mean that you cannot query this file using dates but you can easily insert it into a microsoft access database.
I am super busy right now, but I will come back and write a detailed explanation of my limitations and post it here for others to negatively criticize or tell me how good I am.
You'll find mostly constructive criticism here :) If you think my answer is the best feel free to accept it by clicking the check mark in the top left of my answer.
Abe Miessler