La classe PDOException

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

Introduction

Représente une erreur émise par PDO. Vous ne devez pas lancer une exception PDOException depuis votre propre code. Voir le chapitre sur les exceptions pour plus d'informations concernant les exceptions en PHP.

Synopsis de la classe

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
}

Propriétés

errorInfo

Correspond à PDO::errorInfo() ou PDOStatement::errorInfo()

code

Code erreur SQLSTATE. Utilisez la méthode Exception::getCode() pour y accéder.

To Top