I'm converting a PHP code, which uses mysqli for connecting to mysql database, to a PHP code that uses PDO for connecting to mysql database.
Is there a SQLSTATE which is equivalent to the error code 2006 in mysqli?
Because a piece of my code is written like this:
switch($this->_dbi->errno){
case 2006:
$this->close();
throw new Exception();
break;
}
How can I use PDO to rewrite this code?
SQLSTATE is the return value of PDO::errorCode.
Error 2006(CR_SERVER_GONE_ERROR) means MySQL server has gone away