function ErrorNo()
 {
     return @fbsql_errno($this->_connectionID);
 }
Ejemplo n.º 2
0
Archivo: fbsql.php Proyecto: roojs/pear
 /**
  * Gets the DBMS' native error code produced by the last query
  *
  * @return int  the DBMS' error code
  */
 function errorNative()
 {
     return @fbsql_errno($this->connection);
 }
 /**
  * This method is used to communicate an error and invoke error
  * callbacks etc.  Basically a wrapper for MDB::raiseError
  * that checks for native error msgs.
  *
  * @param integer $errno error code
  * @param string  $message userinfo message
  * @return object a PEAR error object
  * @access public
  * @see PEAR_Error
  */
 function fbsqlRaiseError($errno = NULL, $message = NULL)
 {
     if ($errno == NULL) {
         if ($this->connection) {
             $errno = @fbsql_errno($this->connection);
         } else {
             $errno = @fbsql_errno();
         }
     }
     if ($this->connection) {
         $error = @fbsql_errno($this->connection);
     } else {
         $error = @fbsql_error();
     }
     return $this->raiseError($this->errorCode($errno), NULL, NULL, $message, $error);
 }
Ejemplo n.º 4
0
 /**
  * Gather information about an error, then use that info to create a
  * DB error object and finally return that object.
  *
  * @param  integer  $errno  PEAR error number (usually a DB constant) if
  *                          manually raising an error
  * @return object  DB error object
  * @see DB_common::errorCode()
  * @see DB_common::raiseError()
  */
 function fbsqlRaiseError($errno = null)
 {
     if ($errno === null) {
         $errno = $this->errorCode(fbsql_errno($this->connection));
     }
     return $this->raiseError($errno, null, null, null, @fbsql_error($this->connection));
 }
Ejemplo n.º 5
0
 /**
  * This method is used to collect information about an error
  *
  * @param integer $error
  * @return array
  * @access public
  */
 function errorInfo($error = null)
 {
     if ($this->connection) {
         $native_code = @fbsql_errno($this->connection);
         $native_msg = @fbsql_error($this->connection);
     } else {
         $native_code = @fbsql_errno();
         $native_msg = @fbsql_error();
     }
     if (null === $error) {
         static $ecode_map;
         if (empty($ecode_map)) {
             $ecode_map = array(22 => MDB2_ERROR_SYNTAX, 85 => MDB2_ERROR_ALREADY_EXISTS, 108 => MDB2_ERROR_SYNTAX, 116 => MDB2_ERROR_NOSUCHTABLE, 124 => MDB2_ERROR_VALUE_COUNT_ON_ROW, 215 => MDB2_ERROR_NOSUCHFIELD, 217 => MDB2_ERROR_INVALID_NUMBER, 226 => MDB2_ERROR_NOSUCHFIELD, 231 => MDB2_ERROR_INVALID, 239 => MDB2_ERROR_TRUNCATED, 251 => MDB2_ERROR_SYNTAX, 266 => MDB2_ERROR_NOT_FOUND, 357 => MDB2_ERROR_CONSTRAINT_NOT_NULL, 358 => MDB2_ERROR_CONSTRAINT, 360 => MDB2_ERROR_CONSTRAINT, 361 => MDB2_ERROR_CONSTRAINT);
         }
         if (isset($ecode_map[$native_code])) {
             $error = $ecode_map[$native_code];
         }
     }
     return array($error, $native_code, $native_msg);
 }