I suppose you use a table for store the login and the password for users. When a user want to log at your application, you verify if the login and password are right. Now, if you add a column for store a boolean ( 0 never logging, other value if user have already use your application), when you do your verification you can now tell if it's the first login for this user or not.