updated Database class to effectively handle MySQL functions via PDO