Reduced steps in getquery().
Seperated database info to separate file.