use extract function instead of manually extracting parameters
Change PDO fetch mode for select function to PDO::FETCH_CLASS