ADOdb

Database Abstraction Layer for PHP

User Tools

Site Tools


v5:dictionary:metaforeignkeys

This is an old revision of the document!


metaForeignKeys

Syntax
  mixed metaForeignKeys(
      string $tableName,
      optional string $owner=false,
      optional bool $upperCase=false,
      optional bool $associative=false
      )

Description

The function metaForeignKeys() returns an array of the foreign keys associated with a specific table. If there are no foreign keys then the function returns false.

Optional Parameters

$owner

If specified, only returns foreign keys associated with a table owned by that name. Some drivers discard this parameter

$upper

if specified, only matches the table with the uppercase name. This parameter is discarded by some drivers, and is also superceeded by the [dictionary:setmetacasedvalue|metaCasing]] option

$associative

If specified, returns the result in associative mode. If ADODB_FETCH_MODE is already associative, then this parameter is discarded. Some drivers ignore this parameter.

Usage

/*
 * Connection to DB2 Sample database
*/
$p = $db->metaForeignKeys('ACT');
print_r($p);
/*
 * prints
Array(
  [ACT] => RPAA
  )
*/
 
/*
 * Change the metaCase option to lowercase
 */
 
$db->setMetaCaseOption($db::METACASE_LOWER);
$p = $db->metaForeignKeys('ACT');
print_r($p);
/*
 * prints
Array(
  [act] => rpaa
  )
*/
v5/dictionary/metaforeignkeys.1441766964.txt.gz · Last modified: 2017/04/21 11:28 (external edit)