v5:dictionary:adofieldobject
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
reference:adofieldobject [2015/12/28 03:43] – mnewnham | v5:dictionary:adofieldobject [2023/05/20 17:50] (current) – Fix code sample blocks dregad | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== adoFieldObject ====== | ====== adoFieldObject ====== | ||
===== Description ===== | ===== Description ===== | ||
- | When the [[dictionary: | + | When the [[v5:dictionary:metacolumns]] method is executed by ADOdb, the data retrieved is placed in an array of adoFieldObjects. This is a class based around the following format: |
class ADOFieldObject { | class ADOFieldObject { | ||
Line 14: | Line 14: | ||
^name|The name of the field in the database| | ^name|The name of the field in the database| | ||
^max_length|The meaning of this field varies, based on the type of the field| | ^max_length|The meaning of this field varies, based on the type of the field| | ||
- | ^type|The type of the field as described by the database. In order to retrieve the portable type this value must be sent to the [[dictionary: | + | ^type|The type of the field as described by the database. In order to retrieve the portable type this value must be sent to the [[v5:dictionary:metatype]] method, and the return value used.| |
===== Sample Of Program To Retrieve ADOFieldObjects ===== | ===== Sample Of Program To Retrieve ADOFieldObjects ===== | ||
<code php> | <code php> | ||
- | |||
$SQL = " | $SQL = " | ||
$f = $db-> | $f = $db-> | ||
Line 27: | Line 26: | ||
} | } | ||
</ | </ | ||
+ | |||
===== Examples ===== | ===== Examples ===== | ||
==== SQL Server ==== | ==== SQL Server ==== | ||
- | | + | |
- | ( | + | < |
+ | ADOFieldObject Object | ||
+ | ( | ||
[name] => Freight | [name] => Freight | ||
[max_length] => | [max_length] => | ||
[column_source] => Freight | [column_source] => Freight | ||
[type] => decimal | [type] => decimal | ||
- | | + | ) |
- | | + | ADOFieldObject Object |
- | ( | + | ( |
[name] => ShipName | [name] => ShipName | ||
[max_length] => 40 | [max_length] => 40 | ||
[column_source] => ShipName | [column_source] => ShipName | ||
[type] => nvarchar | [type] => nvarchar | ||
- | | + | ) |
+ | </ | ||
==== IBM DB2 ==== | ==== IBM DB2 ==== | ||
- | | + | |
- | ( | + | < |
+ | ADOFieldObject Object | ||
+ | ( | ||
[name] => ACTNO | [name] => ACTNO | ||
[max_length] => 6 | [max_length] => 6 | ||
[type] => int | [type] => int | ||
- | | + | ) |
- | | + | ADOFieldObject Object |
- | ( | + | ( |
[name] => ACTKWD | [name] => ACTKWD | ||
[max_length] => 6 | [max_length] => 6 | ||
[type] => string | [type] => string | ||
- | | + | ) |
+ | </ | ||
==== MySQL ==== | ==== MySQL ==== | ||
- | Note that currently, MySql does not return an ADOfieldObject object. | + | Note that before ADOdb Version 5.21, MySQL did not return an ADOfieldObject object. |
- | | + | < |
- | ( | + | stdClass Object |
+ | ( | ||
[name] => Code | [name] => Code | ||
[orgname] => Code | [orgname] => Code | ||
Line 84: | Line 91: | ||
[binary] => 0 | [binary] => 0 | ||
[unsigned] => 0 | [unsigned] => 0 | ||
- | | + | ) |
- | + | </ | |
===== Sqlite ===== | ===== Sqlite ===== | ||
- | | + | < |
- | ( | + | ADOFieldObject Object |
+ | ( | ||
[name] => COL1 | [name] => COL1 | ||
[max_length] => 32 | [max_length] => 32 | ||
Line 98: | Line 107: | ||
) | ) | ||
- | | + | ADOFieldObject Object |
- | ( | + | ( |
| | ||
| | ||
Line 106: | Line 115: | ||
| | ||
| | ||
- | | + | ) |
- | | + | ADOFieldObject Object |
- | ( | + | ( |
| | ||
| | ||
Line 116: | Line 125: | ||
| | ||
| | ||
- | | + | ) |
+ | </ |
v5/dictionary/adofieldobject.txt · Last modified: 2023/05/20 17:50 by dregad