PDOException sınıfı

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

Giriş

PDO tarafından oluşturulan bir hatayı temsil eder. Kendi kodunuzda bir PDOException oluşturmamalısınız. PHP'deki istisnalar hakkında bilgi edinmek için İstisnalar bölümüne bakınız.

Sınıf Sözdizimi

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
}

Özellikler

errorInfo

PDO::errorInfo() veya PDOStatement::errorInfo() yöntemine karşılıktır.

code

SQLSTATE hata kodu. Erişmek için Exception::getCode() yöntemini kullanın.

To Top