array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'de', ), 'this' => array ( 0 => 'function.cubrid-error.php', 1 => 'cubrid_error', 2 => 'Get the error message', ), 'up' => array ( 0 => 'cubridmysql.cubrid.php', 1 => 'CUBRID MySQL Compatibility Functions', ), 'prev' => array ( 0 => 'function.cubrid-errno.php', 1 => 'cubrid_errno', ), 'next' => array ( 0 => 'function.cubrid-fetch-array.php', 1 => 'cubrid_fetch_array', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/cubrid/cubridmysql/cubrid-error.xml', ), 'history' => array ( ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); contributors($setup); ?>

cubrid_error

(PECL CUBRID >= 8.3.1)

cubrid_errorGet the error message

Beschreibung

cubrid_error(resource $connection = ?): string

The cubrid_error() function is used to get the error message that occurred during the use of CUBRID API. Usually, it gets error message when API returns false as its return value.

Parameter-Liste

connection

The CUBRID connection.

Rückgabewerte

Error message that occurred.

Beispiele

Beispiel #1 cubrid_error() example

<?php
$con
= cubrid_connect('localhost', 33000, 'demodb', 'dba', '');
$req = cubrid_execute($con, "select id, name from person");
if (
$req) {
while (list (
$id, $name) = cubrid_fetch($req))
echo
$id, $name;
} else {
echo
"Error Code: ", cubrid_errno($con);
echo
"Error Message: ", cubrid_error($con);
}
?>

Das oben gezeigte Beispiel erzeugt folgende Ausgabe:

Error Code: -493 Error Message: Syntax: Unknown class "person". select id, [name] from person

Siehe auch