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

PHP Basic Tutorial

PHP Advanced Tutorial

PHP & MySQL

PHP Reference Manual

PHP odbc_table() Function Usage and Example

PHP ODBC Reference Manual

The odbc_table() function is used to get a list of table names stored in a specific data source

Syntax

resource odbc_tables ( resource $connection_id[, string $qualifier 
   [, string $owner[, string $name[, string $types]]]] )

Definition and Usage

It is used to get a list of table names stored in a specific data source

Return Value

Returns an odbc result identifier on success, otherwise returns false

Parameter

NumberParameters and Description
1

connection_id

It contains information about connection identifiers

2

qualifier

It contains information about qualifiers

3

owner

It contains information about the owner

4

name

It contains information about table names

Example

Try the following example

<?php
   $dbh = odbc_connect($dsn, $user_id, $pwd_id);
   $result = odbc_tables($dbh);
   $tables = array();
   
   while (odbc_fetch_row($result)){
      if(odbc_result($result, "TABLE_TYPE") == "TABLE")
      echo "  " . odbc_result($result, "TABLE_NAME");
   }
?>

PHP ODBC Reference Manual