remove some sql class function calls in favour of PDO calls