v5:userguide:learn_dictionary:metacolumns
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| v5:userguide:learn_dictionary:metacolumns [2016/03/16 02:35] – created mnewnham | v5:userguide:learn_dictionary:metacolumns [2016/03/20 15:05] (current) – [MetaColumns] mnewnham | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | <- v5: | + | <- v5: |
| ~~NOTOC~~ | ~~NOTOC~~ | ||
| ====== MetaColumns ====== | ====== MetaColumns ====== | ||
| - | The metaColumns method returns an array of [[v5: | + | The metaColumns method returns an array of [[v5: |
| + | <code php> | ||
| + | $m = $db-> | ||
| + | |||
| + | print_r($m); | ||
| + | </ | ||
| adoFieldObject Object | adoFieldObject Object | ||
| ( | ( | ||
| [name] => actno | [name] => actno | ||
| - | [max_length] => 2 | + | [max_length] => 8 |
| - | [type] => I | + | [type] => INT |
| ) | ) | ||
| + | | ||
| + | adoFieldObject Object | ||
| + | ( | ||
| + | [name] => actname | ||
| + | [max_length] => 30 | ||
| + | [type] => VARCHAR | ||
| + | ) | ||
| + | |||
| + | |||
| + | Note that the type of the data returned is the [[v5: | ||
| + | $db-> | ||
| + | |||
| + | For example, in the example above, the ' | ||
| + | |||
| + | ===== Extended Attributes ===== | ||
| + | Some drivers return an extended set of attributes that represent DBMS specific functionality. For example, the IBM DB2 driver returns the normal 3 attributes above plus the following 3: | ||
| + | |||
| + | [not_null] => | ||
| + | [scale] => | ||
| + | [primary_key] => | ||
| + | |||
| + | If you are writing portable applications you should not rely on these attributes to be available across all databases. | ||
| + | ===== metaColumnNames ===== | ||
| + | This method [[v5: | ||
| + | <code php> | ||
| + | $ar = $db-> | ||
| + | print_r($ar); | ||
| + | /* | ||
| + | * Returns: | ||
| + | COLUMN_1=> | ||
| + | COLUMN_2=> | ||
| + | COLUMN_3=> | ||
| + | */ | ||
| + | </ | ||
v5/userguide/learn_dictionary/metacolumns.1458092117.txt.gz · Last modified: (external edit)
