How to get the error code from MYSQL via PDO as integer?
try{
...
}
catch(PDOException $e){
throw new Fatal($e->getMessage(), $e->getCode());
}
$e->getCode()
will return something like HY000
Argument 2 passed to Fatal::__construct() must be of the type integer, string given ...
... Fatal->__construct('SQLSTATE[HY000]...', 'HY000')