Save login attempts to the database