school attendance

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
xionhack
Forum Contributor
Posts: 100
Joined: Mon Nov 10, 2008 9:22 pm

school attendance

Post 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!
JakeJ
Forum Regular
Posts: 675
Joined: Thu Dec 10, 2009 6:27 pm

Re: school attendance

Post 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.
xionhack
Forum Contributor
Posts: 100
Joined: Mon Nov 10, 2008 9:22 pm

Re: school attendance

Post 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.
User avatar
omniuni
Forum Regular
Posts: 738
Joined: Tue Jul 15, 2008 10:50 pm
Location: Carolina, USA

Re: school attendance

Post 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.
Post Reply