replace def sql connection mode to PDO