vid 27&28:
created __construct function, openConnection function, closeConnection function, and query function