Wait, the database is offsite? Ok. You obviously know you have to have access/credentials for that.
But if you do, though not sure which database it is, am sure coding a program that executes Database statements and queries for that specific need not take you a whole search of google.
To save you the pain of searching everytime you need to code something, grab some SQL book and learn some queries, et-la. OR else you will never learn by copy pasting code.