seperated conection to database ina  new file.

put up a sucsses/error message