Writing config file based on DB deets