I have tried a bit of searching, and as a result found the count() function to get me closer to my goal, but have stopped a bit. Here's what my code looks like now:
$sql = "SELECT COUNT( * ) as Count
FROM AttendanceDB
WHERE YEAR( class_time ) = '2015'
AND studentid = '$studentid'
AND furikae = 0
GROUP BY MONTH( class_time )";
Then I use echo $row['Count'];
to output the data.
This allows me to total the number of rows per month for the year of 2015 and then output the answer. Now what I want to do is output the month in each row along with the total. I could just preformat everything, but there are some studentids which have entries beginning partway through the year, which means that the first months don't output any results.
How can I SELECT both the month from the DB as well as use the count function at the same time? Thanks