update database for global variable function