Icon edb_errcode

Returns the error code for the last API call.

Syntax
edb_errcode()

Returns
Last error code (INTEGER) if successful, and FALSE if
there are any errors

Usage
The edb_errcode function returns the error code for the last call to any of the edb_* functions present in the ElevateDB PHP Extension API. For a list of all ElevateDB error codes and messages, please see Appendix A - Error Codes and Messages.

Information This function only returns the error code for the last API call. Any subsequent calls to edb_* functions will clear any error codes/messages.

<?php

// The following script connects to an ElevateDB
// Server and database, returning any error code/message
// if there was an error connecting

$con = edb_connect("type=remote;charset=Ansi;address=127.0.0.1;"+
                   "uid=Administrator;pwd=EDBDefault;database=Test");
if (!$con)
  {
  die("Could not connect: (" . edb_errcode() . ") " . edb_errmsg());
  }

$cmd = edb_prepare($con,"customer",EDB_COMMAND_TABLE);
$cursor = edb_execute($cmd);

edb_disconnect($con);
?>
Image