I've been always curious how would badges be made (like these in Stackoverflow) with PHP.
I was thinking about 3 tables for storaging the data, but how, when & why should I do the checks for earning badges.
For example: badge - first post or badge - 2000 posts.
I'm a beginner in thinking like a programmer and i'm looking for best practices and so.