updated db connection to use pdo
initial conversion of queries to pdo statements
kind of works, but realised there's a bit in part c i didn't finish