convert to PDOs

login using pdo instead of prepared statements,
all functions return object with success attribute,
make use of reportError and logError