Page 1 of 1

school attendance

Posted: Tue Apr 13, 2010 3:34 pm
by xionhack
Hello. I have a quick question. I am making a school database and I want to do an attendance form. I am a little bit confused of what is the best approach. Right now i did this.

One table (member) with member_id and student_name. One "attendance" table with attendance_id, attendance_date, student_id, type_attendace. Type_attendance means a code to differentiate if the person is late or on time.

Then in the php i will have a type of grid, that gives me in the left all the names of the student, and then to the right a box where i write the code. Is that the best approach to do this? thanks!

Re: school attendance

Posted: Tue Apr 13, 2010 6:51 pm
by JakeJ
Tables:

students
------------
id
student_name
other_details

classes
-------------
id
instructor_id (from instructors.id)
room_number
other_details

instructors
-------------
id
instructor_name
other_details

types
-----------
id
type

attendance
-------------
id
student_id (from students.id)
instructor_id ( from instructors.id)
class_id (from classes.id
date (date field)
type_id (from types.id)

Using that structure (and whatever naming convention you want), adapted to suit your other needs should be the right start.

I hope that helps.

Re: school attendance

Posted: Tue Apr 13, 2010 8:46 pm
by xionhack
Hello. Thanks for your answer. I am sorry I said it was for a school attendance, by what I see it brought some confusion.

Its not really for a school. I dont need to record class, or instructor. Just pretty much if a person came on that day, and if he came on time or not. I need to check for every day of the week.

Re: school attendance

Posted: Tue Apr 13, 2010 10:16 pm
by omniuni
Just remove the extra stuff from JakeJ's schema. You may want to consider using a drop-down menu instead of typing a code, but it sounds like you have the right general idea.