converting readin to use pdo