v5:dictionary:metaforeignkeys
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
dictionary:metaforeignkeys [2015/09/09 04:49] – mnewnham | v5:dictionary:metaforeignkeys [2016/01/13 02:06] – ↷ Page moved from dictionary:metaforeignkeys to v5:dictionary:metaforeignkeys mnewnham | ||
---|---|---|---|
Line 16: | Line 16: | ||
If specified, only returns foreign keys associated with a table owned by that name. Some drivers discard this parameter | If specified, only returns foreign keys associated with a table owned by that name. Some drivers discard this parameter | ||
==== $upper ==== | ==== $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: | + | if specified, only matches the table with the uppercase name. This parameter is discarded by some drivers |
==== $associative==== | ==== $associative==== | ||
If specified, returns the result in associative mode. If ADODB_FETCH_MODE is already associative, | If specified, returns the result in associative mode. If ADODB_FETCH_MODE is already associative, | ||
+ | ===== Return Value ===== | ||
+ | The method returns an array of data: | ||
+ | * the main key represents the foreign table that the key associated with. | ||
+ | * The values of the key are either a key=> | ||
+ | |||
===== Usage ===== | ===== Usage ===== | ||
<code php> | <code php> | ||
/* | /* | ||
- | * Connection to DB2 Sample database | + | * Connection to MySql Employees |
*/ | */ | ||
- | $p = $db-> | + | $db-> |
+ | |||
+ | $p = $db-> | ||
print_r($p); | print_r($p); | ||
/* | /* | ||
* prints | * prints | ||
- | Array( | + | Array |
- | [ACT] => RPAA | + | ( |
- | ) | + | [employees] => Array |
- | */ | + | ( |
+ | [0] => emp_no=emp_no | ||
+ | ) | ||
- | /* | + | [departments] => Array |
- | * Change the metaCase option to lowercase | + | ( |
- | */ | + | [0] => dept_no=dept_no |
+ | ) | ||
- | $db->setMetaCaseOption($db:: | + | ) |
- | $p = $db-> | + | */ |
+ | </ | ||
+ | ==== Same Code In Associative Mode ==== | ||
+ | <code php> | ||
+ | $db->setFetchMode(ADODB_FETCH_ASSOC); | ||
+ | |||
+ | $p = $db-> | ||
print_r($p); | print_r($p); | ||
/* | /* | ||
* prints | * prints | ||
- | Array( | + | Array |
- | [act] => rpaa | + | ( |
- | ) | + | [employees] => Array |
+ | ( | ||
+ | [emp_no]=> | ||
+ | ) | ||
+ | |||
+ | [departments] => Array | ||
+ | ( | ||
+ | [dept_no]=> | ||
+ | ) | ||
+ | |||
+ | ) | ||
*/ | */ | ||
</ | </ | ||
v5/dictionary/metaforeignkeys.txt · Last modified: 2021/11/08 17:44 by dregad