v5:dictionary:metaforeignkeys
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
dictionary:metaforeignkeys [2016/01/03 01:30] – mnewnham | v5:dictionary:metaforeignkeys [2021/11/08 17:44] (current) – [metaForeignKeys] change default value for $tableName dregad | ||
---|---|---|---|
Line 5: | Line 5: | ||
mixed metaForeignKeys( | mixed metaForeignKeys( | ||
string $tableName, | string $tableName, | ||
- | optional string $owner=false, | + | optional string $owner='' |
optional bool $upperCase=false, | optional bool $upperCase=false, | ||
optional bool $associative=false | optional bool $associative=false | ||
Line 19: | Line 19: | ||
==== $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> | ||
Line 24: | Line 29: | ||
* Connection to MySql Employees Sample database | * Connection to MySql Employees Sample database | ||
*/ | */ | ||
+ | $db-> | ||
+ | |||
$p = $db-> | $p = $db-> | ||
print_r($p); | print_r($p); | ||
Line 41: | Line 48: | ||
) | ) | ||
- | + | */ | |
+ | </ | ||
+ | ==== Same Code In Associative Mode ==== | ||
+ | <code php> | ||
+ | $db-> | ||
+ | |||
+ | $p = $db-> | ||
+ | print_r($p); | ||
+ | /* | ||
+ | * prints | ||
+ | Array | ||
+ | ( | ||
+ | [employees] => Array | ||
+ | ( | ||
+ | [emp_no]=> | ||
+ | ) | ||
+ | |||
+ | [departments] => Array | ||
+ | ( | ||
+ | [dept_no]=> | ||
+ | ) | ||
+ | |||
+ | ) | ||
+ | */ | ||
</ | </ | ||
v5/dictionary/metaforeignkeys.1451781013.txt.gz · Last modified: 2017/04/21 11:27 (external edit)