You'll need a database...

then it's very easy.. just update the count field of the table when they login.