| ADOdb Library for PHP Manual |
| Prev |
MetaType |
Next |
MetaType($nativeDBType[,$field_max_length],[$fieldobj])
Determine what generic meta type a database field type is given its native type
$nativeDBType as a string and the length of the field $field_max_length.
Note that field_max_length can be -1 if it is not known. The field object returned
by FetchField() can be passed in $fieldobj or as the 1st parameter $nativeDBType. This is useful
for databases such as mysql which has additional properties in the field
object such as primary_key.
Uses the field blobSize and compares it with $field_max_length
to determine whether the character field is actually a blob.
For example, $db->MetaType('char') will return 'C'.
Returns:
- C: Character fields that should be shown in a <input
type="text"> tag.
- X: Clob (character large objects), or large text fields
that should be shown in a <textarea>
- D: Date field
- T: Timestamp field
- L: Logical field (boolean or bit-field)
- N: Numeric field. Includes decimal, numeric, floating point,
and real.
- I: Integer field.
- R: Counter or Autoincrement field. Must be numeric.
- B: Blob, or binary large objects.
Since ADOdb 3.0, MetaType accepts $fieldobj as the first parameter, instead
of $nativeDBType.