我尝试在PDO中获取连接上的错误消息,但它返回SQLSTATE[HY000] [1045] Access denied for user 'aa'@'localhost' (using password以及代码和SQLSTATE部分。有办法只获取Access denied for user 'aa'@'localhost' (using password: YES)部件吗?如何在1045之后提取部分,以便只打
', 'error' => $exception->getMessage()]); if ($exception instanceof \PDOException) {显示PDO异常消息将导致如下结果: SQLSTATE[HY000]: General error: 1364 Field 'fiscal_code' doesn't have a default value我想要一个简单的消息,比如: SQ