Table of Contents
valentina_errno()
Declaration
int valentina_errno ( [resource link_identifier] )
Parameters
Name | Description | |
---|---|---|
link_identifier | The 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. |
Description
Returns the error number from the last VSerever function.
Errors coming back from the VServer database backend no longer issue warnings. Instead, use valentina_errno() to retrieve the error code. Note that this function only returns the error code from the most recently executed VServer 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 number from the last VServer function, or 0 (zero) if no error occurred.
Examples
Example 1.
<?php $link = valentina_connect('localhost', 'val_user', 'val_password'); if (!valentina_select_db('nonexistentdb', $link)) { echo valentina_errno($link) . ": " . valentina_error($link). "\n"; } valentina_select_db("test_db", $link); if (!valentina_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.
Notes
Complete list of the VServer error codes available in the VServer technical documentation.