Added db_script

File db_script where all the database related functions (connect, close)
should be place instead of repeating them in other files;
Modified login_scripts to use these new functions