ADOdb

Database Abstraction Layer for PHP

User Tools

Site Tools


v5:dictionary:dictionary_index

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
v5:dictionary:dictionary_index [2016/05/01 18:24] – [Table] mnewnhamv5:dictionary:dictionary_index [2016/05/13 17:04] – [Table] mnewnham
Line 9: Line 9:
 ADOdb provides a cross-platform method of identifying the data type of a field. These values can be used as a replacement in code that relies on the data type of field to produce a result. Each database driver contains a cross-reference table of datatypes that can accessed using the [[v5:dictionary:metatype|metaType()]] method. ADOdb provides a cross-platform method of identifying the data type of a field. These values can be used as a replacement in code that relies on the data type of field to produce a result. Each database driver contains a cross-reference table of datatypes that can accessed using the [[v5:dictionary:metatype|metaType()]] method.
 ==== Summary Of Types ==== ==== Summary Of Types ====
-^ Type  ^ Represents Field Types                                                                                                                                                                 ^ When Using addColumnSql               ^ Example +^ Type  ^ Represents Field Types                                                                                                                                                                    ^ When Using addColumnSql               ^ Example 
-| C     | character fields that should be shown in a <input type="text"> tag                                                                                                                     | Add the length of the field           | C(20)    | +| C     | character fields that should be shown in a <input type="text"> tag                                                                                                                        | Add the length of the field           | C(20)    | 
-| C2    | Like a C field, but where possible a field that can hold multi-byte (unicode) data is created                                                                                          | Add the length of the field           | C2(20)   | +| C2    | Like a C field, but where possible a field that can hold multi-byte (unicode) data is created                                                                                             | Add the length of the field           | C2(20)   | 
-| X     | TeXt, large text or CLOB fields that should be shown in a <textarea>                                                                                                                   |                                                | +| X     | TeXt, large text or CLOB fields that should be shown in a <textarea>                                                                                                                      |                                                | 
-| X2    | Like an X field, but where possible creates a field that can hold multi-byte (unicode) data is created                                                                                 |                                                | +| X2    | Like an X field, but where possible creates a field that can hold multi-byte (unicode) data is created                                                                                                                                   | 
-| B     | Blobs, or Binary Large Objects. Typically images.                                                                                                                                      |                                                | +| XL    | On systems that support it, creates a large clob field (32K). This may require additional database configuration. If the database does not support it, a standard clob field is created.  |                                                | 
-| D     | Date (sometimes DateTime) field                                                                                                                                                        |                                                | +| B     | Blobs, or Binary Large Objects. Typically images.                                                                                                                                         |                                                | 
-| T     | Timestamp field                                                                                                                                                                        |                                                | +| D     | Date (sometimes DateTime) field                                                                                                                                                           |                                                | 
-| L     | Logical field (boolean or bit-field). Some databases emulate logicals using I2 fields                                                                                                  |                                                | +| T     | Timestamp field                                                                                                                                                                           |                                                | 
-| I     | Integer field, This may be broken down further into I2,I4 or I8 types to represent small,medium and large integers. The largest integer data size is always represented by an I field  |                                                | +| L     | Logical field (boolean or bit-field). Some databases emulate logicals using I2 fields                                                                                                     |                                                | 
-| N     | Numeric field. Includes autoincrement, numeric, floating point, real and integer.                                                                                                      | Add the precision and decimal digits  | N 14.4   | +| I     | Integer field, This may be broken down further into I2,I4 or I8 types to represent small,medium and large integers. The largest integer data size is always represented by an I field     |                                                | 
-| R     | Serial field. Includes serial, autoincrement integers. This works for selected databases. Some databases do not signify if a field is auto-increment                                   |                                                |+| N     | Numeric field. Includes autoincrement, numeric, floating point, real and integer.                                                                                                         | Add the precision and decimal digits  | N 14.4   | 
 +| R     | Serial field. Includes serial, autoincrement integers. This works for selected databases. Some databases do not signify if a field is auto-increment                                      |                                                |
 ==== Using Data Types For Non-Portable Applications ==== ==== Using Data Types For Non-Portable Applications ====
 There are benefits to using ADOdb data types even when writing an application that is not designed to be portable. The ''metaType()'' method can hide numerous data sub-types from a developer, when the difference in the field is not important. For example the following actual data types in the [[v5:database:microsoft_sql_server]] driver are all represented by the ADOdb type ''C'': There are benefits to using ADOdb data types even when writing an application that is not designed to be portable. The ''metaType()'' method can hide numerous data sub-types from a developer, when the difference in the field is not important. For example the following actual data types in the [[v5:database:microsoft_sql_server]] driver are all represented by the ADOdb type ''C'':
v5/dictionary/dictionary_index.txt · Last modified: 2023/06/04 11:41 by dregad