ADOdb

Database Abstraction Layer for PHP

User Tools

Site Tools


v5:userguide:learn_dictionary:metatypes

Differences

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

Link to this comparison view

Next revision
Previous revision
v5:userguide:learn_dictionary:metatypes [2016/03/16 01:47] – created mnewnhamv5:userguide:learn_dictionary:metatypes [2016/03/17 00:08] (current) – [Using MetaTypes] mnewnham
Line 9: Line 9:
 In total, ADOdb knows about 150 different Actual data types, and can simplify them down to 9 MetaTypes. In total, ADOdb knows about 150 different Actual data types, and can simplify them down to 9 MetaTypes.
  
 +^ Type  ^ Represents Field Types                                                                                                                                                                 ^
 +| C     | character fields that should be shown in a <input type="text"> tag                                                                                                                     |
 +| X     | TeXt, large text or CLOB fields that should be shown in a <textarea>                                                                                                                   |
 +| B     | Blobs, or Binary Large Objects. Typically images.                                                                                                                                      |
 +| D     | Date (sometimes DateTime) field                                                                                                                                                        |
 +| T     | Timestamp field                                                                                                                                                                        |
 +| L     | Logical field (boolean or bit-field). Some databases emulate logicals using I2 fields                                                                                                  |
 +| 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  |
 +| N     | Numeric field. Includes autoincrement, numeric, floating point, real and integer.                                                                                                      |
 +| R     | Serial field. Includes serial, autoincrement integers. This works for selected databases. Some databases do not signify if a field is auto-increment                                   |
 +
 +If ADOdb encounters a field type that it does not know about, It provides a method of defaulting the field handling.
 +
 +===== Using MetaTypes =====
 +PHP programs often include code that branches based on the type of data available, for example to format numbers based on whether they are integer or floating point. Using the MetaType simplifies the branching by representing possibly 5-10 Actual Types of Floating Point numbers with a single Metatype, **N**.
 +
 +The next page in the lesson will show how to retrieve and use MetaTypes
v5/userguide/learn_dictionary/metatypes.1458089254.txt.gz · Last modified: 2017/04/21 11:40 (external edit)