本文整理汇总了PHP中cubrid_errno函数的典型用法代码示例。如果您正苦于以下问题:PHP cubrid_errno函数的具体用法?PHP cubrid_errno怎么用?PHP cubrid_errno使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了cubrid_errno函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _error_number
/**
* The error message number
*
* @access private
* @return integer
*/
function _error_number()
{
return cubrid_errno($this->conn_id);
}
示例2: get_db_error_message
/**
* Retrieve error messages from the database
*
* @return string
*/
protected function get_db_error_message()
{
if (substr(CI_VERSION, 0, 1) != '2') {
$error = $this->db->error();
return isset($error['message']) ? $error['message'] : '';
}
switch ($this->db->platform()) {
case 'cubrid':
return cubrid_errno($this->db->conn_id);
case 'mssql':
return mssql_get_last_message();
case 'mysql':
return mysql_error($this->db->conn_id);
case 'mysqli':
return mysqli_error($this->db->conn_id);
case 'oci8':
// If the error was during connection, no conn_id should be passed
$error = is_resource($this->db->conn_id) ? oci_error($this->db->conn_id) : oci_error();
return $error['message'];
case 'odbc':
return odbc_errormsg($this->db->conn_id);
case 'pdo':
$error_array = $this->db->conn_id->errorInfo();
return $error_array[2];
case 'postgre':
return pg_last_error($this->db->conn_id);
case 'sqlite':
return sqlite_error_string(sqlite_last_error($this->db->conn_id));
case 'sqlsrv':
$error = array_shift(sqlsrv_errors());
return !empty($error['message']) ? $error['message'] : null;
default:
// !WARNING! $this->db->_error_message() is supposed to be private
// and possibly won't be available in future versions of CI.
return $this->db->_error_message();
}
}
示例3: error
/**
* Error
*
* Returns an array containing code and message of the last
* database error that has occured.
*
* @return array
*/
public function error()
{
return array('code' => cubrid_errno($this->conn_id), 'message' => cubrid_error($this->conn_id));
}
示例4: get_db_error_message
/**
* Allows you to retrieve error messages from the database
*
* @return string
*/
public function get_db_error_message($db_type)
{
switch ($this->{$db_type}->platform()) {
case 'cubrid':
return cubrid_errno($this->{$db_type}->conn_id);
case 'mssql':
return mssql_get_last_message();
case 'mysql':
return mysql_error($this->{$db_type}->conn_id);
case 'mysqli':
return mysqli_error($this->{$db_type}->conn_id);
case 'oci8':
// If the error was during connection, no conn_id should be passed
$error = is_resource($this->{$db_type}->conn_id) ? oci_error($this->{$db_type}->conn_id) : oci_error();
return $error['message'];
case 'odbc':
return odbc_errormsg($this->{$db_type}->conn_id);
case 'pdo':
$error_array = $this->{$db_type}->conn_id->errorInfo();
return $error_array[2];
case 'postgre':
return pg_last_error($this->{$db_type}->conn_id);
case 'sqlite':
return sqlite_error_string(sqlite_last_error($this->{$db_type}->conn_id));
case 'sqlsrv':
$error = array_shift(sqlsrv_errors());
return !empty($error['message']) ? $error['message'] : null;
default:
/*
* !WARNING! $this->{$db_type}->_error_message() is supposed to be private and
* possibly won't be available in future versions of CI
*/
return $this->{$db_type}->_error_message();
}
}