updated db connection code

for files "accept_code, update_location"