added error traps in database connection. error messages will echo to the page.