v5:dictionary:metaforeignkeys
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| dictionary:metaforeignkeys [2015/08/12 02:05] – created mnewnham | v5:dictionary:metaforeignkeys [2026/02/26 00:40] (current) – [Return Value] 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 14: | Line 14: | ||
| ===== Optional Parameters ===== | ===== Optional Parameters ===== | ||
| ==== $owner ==== | ==== $owner ==== | ||
| - | If specified, only returns foreign keys associated with a table owned by that name. | + | If specified, only returns foreign keys associated with a table owned by that name. Some drivers discard this parameter |
| ==== $upper ==== | ==== $upper ==== | ||
| - | if specified, | + | if specified, the table and columns are returned in uppercase. Default is lowercase. |
| ==== $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=> | ||
| + | * a numeric key with value being the same data represented as '' | ||
| + | |||
| + | ===== Explanation ===== | ||
| + | A table **// | ||
| + | ==== Associative Mode ==== | ||
| + | <code php> | ||
| + | [ | ||
| + | [' | ||
| + | [' | ||
| + | [' | ||
| + | ] | ||
| + | ] | ||
| + | </ | ||
| + | ==== Numeric Mode ==== | ||
| + | <code php> | ||
| + | [ | ||
| + | [' | ||
| + | [0] => ' | ||
| + | [1] => ' | ||
| + | ] | ||
| + | ] | ||
| + | </ | ||
| ===== Usage ===== | ===== Usage ===== | ||
| - | <WRAP todo> | + | <code php> |
| - | Add Example of this | + | /* |
| - | </WRAP> | + | * Connection to MySql Employees Sample database |
| + | */ | ||
| + | $db-> | ||
| + | |||
| + | $p = $db-> | ||
| + | print_r($p); | ||
| + | /* | ||
| + | * prints | ||
| + | Array | ||
| + | ( | ||
| + | [employees] => Array | ||
| + | ( | ||
| + | [0] => emp_no=emp_no | ||
| + | ) | ||
| + | |||
| + | [departments] => Array | ||
| + | ( | ||
| + | [0] => dept_no=dept_no | ||
| + | ) | ||
| + | |||
| + | ) | ||
| + | */ | ||
| + | </ | ||
| + | ==== Same Code In Associative Mode ==== | ||
| + | <code php> | ||
| + | $db-> | ||
| + | |||
| + | $p = $db-> | ||
| + | print_r($p); | ||
| + | /* | ||
| + | * prints | ||
| + | Array | ||
| + | ( | ||
| + | [employees] => Array | ||
| + | ( | ||
| + | [emp_no]=> | ||
| + | ) | ||
| + | |||
| + | [departments] => Array | ||
| + | ( | ||
| + | [dept_no]=> | ||
| + | ) | ||
| + | |||
| + | ) | ||
| + | */ | ||
| + | </code> | ||
v5/dictionary/metaforeignkeys.1439337906.txt.gz · Last modified: (external edit)
