Use PDO for GetByCredentials function (not sure why MySQL doesn't work,
but we should be upgrading to PDO anyway)