The Messages table in the database has two timestamp fields to record when each message was created and last modified. Maybe you could add a column to the Users table to store the timestamp of the latest message viewed by the user, then compare that to the latest created/modified date in the Messages table to see if anything has been posted since then.