English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Basic PHP Tutorial

Advanced PHP Tutorial

PHP & MySQL

PHP Reference Manual

Usage and Example of PHP odbc_error() Function

PHP ODBC Reference Manual

The odbc_error() function retrieves the last error code.

Syntax

string odbc_error ([ resource $connection_id ] )

Definition and Usage

It is used to get the last code error information

Return Value

If connection_id is specified, it returns the last status of that connection; otherwise, it returns the last status of any connection.
This function returns a meaningful value only when the last ODBC query fails (i.e., odbc_exec() returns false).

Parameter

Serial NumberParameters and Description
1

connection_id

It contains information about the connection ID

Example

Try the following example

<?php
   if (odbc_error()) {
      echo odbc_errormsg($conn);
   }      
?>

PHP ODBC Reference Manual