db_pdo_mysql::error PHP Method

error() public method

设置错误。
public error ( $errno, $errstr = '' )
    public function error($errno = 0, $errstr = '')
    {
        $error = $this->link ? $this->link->errorInfo() : array(0, $errno, $errstr);
        $this->errno = $errno ? $errno : (isset($error[1]) ? $error[1] : 0);
        $this->errstr = $errstr ? $errstr : (isset($error[2]) ? $error[2] : '');
        DEBUG and trigger_error('Database Error:' . $this->errstr);
    }