PDOException クラス

(PHP 5 >= 5.1.0, PHP 7, PHP 8)

はじめに

PDO が発するエラーを表します。あなた自身が書いたコードから PDOException をスローしてはいけません。 PHP の例外についての詳細な情報は、 例外 を参照ください。

クラス概要

classPDOExceptionextendsRuntimeException {
protectedint|string$code;
public?array$errorInfo = null;
protectedstring$message = "";
privatestring$string = "";
protectedint$code;
protectedstring$file = "";
protectedint$line;
privatearray$trace = [];
private?Throwable$previous = null;
publicException::__construct(string$message = "", int$code = 0, ?Throwable$previous = null)
finalpublicException::getCode(): int
finalpublicException::getLine(): int
}

プロパティ

errorInfo

PDO::errorInfo() あるいは PDOStatement::errorInfo() に対応します。

code

SQLSTATE エラーコード。 Exception::getCode() でアクセスします。

To Top