do you mean frozen if it's not used for a month, or just frozen every month? I'm going to assume the first, but it's not difficult to see the changes to make if you want the latter.
In your user table vreate a field called "frozen" and make it an ENUM field with values "Y" or "N", default set to "N". You also want to create a field to store your timestamps in, call it "last_used" variable type int (unsigned).
all that shouldnt be too bad. What you want to do then is every time someone logs in or something add the timestamp to the table: you'd want a query that did something along the lines of:
$sql = "UPDATE table set last_used = ".mktime()." where username = '".$username."'";
then all you need to do is at the start of some page (doesnt matter which, as long as it's called quite a bit, so something like your logon page or something) have this bit of code:
$freeze_days = 30;
$sql = "update table set frozen = 'Y' where last_used < ".($freeze_days*24*60*60);
and that will then update your table and set all the accounts to frozen if they've been inactive for 30 days or more.
Then all you need on your login script is something to check that the frozen is set to N, otherwise it tells them that their account hjas been frozen, and then you can do with them what you want. Does that make sense?