Limiting the number of appointments per a month per user.


I am creating a tutoring site where my students can make appointments with our tutors. Students will be paying a monthly fee, and I would like to limit their appointments to 4 - 6 appointments in a given month.

I ran into this post

and below, a developer left some code I can add to the functions.php which limits the number of appointments for each user. But, I am not sure what to do next after i add the code. In the post the developer adds that I have to do something to the mySQL, but i have no idea what i need to do.

Please help me! = )

Thank you guys!