Which is better: more rows or more columns in a student attendance table? I want to create an attendance table for student attendance. Which structure should I go for?

I have two options.


attendance(student_id,date,is_absent,reason)
attendance(student_id,d1,d2,d3,d4,...,d30,d31,is_absent,reason)


Scenario: assuming 100 students in which 50 are absent all 31 days for about 5 months. In case 1 with the assumed scenario the number of total rows is 50 absent * 31days * 5month  =7750
At the same time case 2 will create 100 rows irrespective of number of absentees and the respective data is filled if the student is absent. So in total in case 2 100 * 5 months = 500 rows and 500 * 31 cols = 15500 cells (scenario doesn't matter in rows and cols but the number of cells filled is 50 absent * 31 days * 5 month = 7750)

Which one should I go for and would it be fast in querying when I query for attendance report or anything similar?
PS: MySQL as database and queries are sent from PHP
There are several disadvantages to using the "month-based row" approach, and I do not see any advantage.


Using a row to represent an instance of attendance for a student makes logical sense. Using a row to represent a month's worth of attendance is arbitrary--why a month instead of a year or a 6-week cycle?
Think about how you'll be querying this data, or how you'll write a parameterized report for your users--when you're asked to find how many students were absent on a specific day, you'll need to parse out the month to find the right record, then look at different columns depending on the day of the month. Needless complication.
Right now, it looks like you want to record whether they are absent and the reason, but that will change eventually. You'll need to add a comment to explain the reason, whether it was approved, or some such, and you don't want to add 31 columns to your table every time that happens.