saving max_rows and max_data to database