Switch to: V11V10V9V8V7V6V5



string valentina_error ( [resource link_identifier] )


Name Description
link_identifierThe VServer connection. If the link identifier is not specified, the last link opened by valentina_connect() is assumed. If by chance no connection is found, an E_WARNING level warning is generated.


Returns the error text from the last VServer function. Errors coming back from the VServer database backend no longer issue warnings. Instead, use valentina_error() to retrieve the error text. Note that this function only returns the error text from the most recently executed VSever function (not including valentina_error() and valentina_errno()), so if you want to use it, make sure you check the value before calling another VServer function.

Return Values

Returns the error text from the last VServer function, or '' (empty string) if no error occurred.


Example 1.

$link = valentina_connect("localhost", "val_user", "val_password");
valentina_select_db("nonexistentdb", $link);
echo val_errno($link) . ": " . valentina_error($link). "\n";
valentina_select_db("test_database", $link);
val_query("SELECT * FROM nonexistenttable", $link);
echo valentina_errno($link) . ": " . valentina_error($link) . "\n";

The above example will output something similar to:

533764: Invalid database name.
460035: Table "nonexistenttable" not found.


Complete list of the VServer error codes available in the VServer technical documentation.

See Also