added databse connect file
added a few database helper functions