PHP 8.4.1 Released!

odbc_field_type

(PHP 4, PHP 5, PHP 7, PHP 8)

odbc_field_typeTipo de dados de um campo

Descrição

odbc_field_type(resource $statement, int $field): string|false

Obtém o tipo SQL do campo referenciado pelo número em um identificador de resultado informado.

Parâmetros

statement

O identificador de resultado.

field

O número do campo. Campos são numerados a partir de 1.

Valor Retornado

Retorna o tipo do campo como uma string, ou false em caso de erro.

adicione uma nota

Notas Enviadas por Usuários (em inglês) 5 notes

up
1
jschwartz at the-infoshop dot com
15 years ago
Quick note: as noted below, MS Access type AutoNumber comes across as type COUNTER. What I didn't see mentioned is that PHP interprets type COUNTER as a string, not an integer.

More annoying than anything else, in my particular case; but I'd guess it could bite somebody, somewhere.
up
1
jazper at lycos dot de
22 years ago
Returntypes on Access2000
COUNTER - Autoincrement
VARCHAR - Text
LONGCHAR - Memo
INTEGER - Number
DATETIME - Date/Time
CURRENCY - Currency
BIT - TRUE/FALSE
LONGBINARY - OLE-Object
LONGCHAR - Hyperlink

cheers, j.a.z.
up
0
ted at convey dot de
9 years ago
odbc_field_type seems to return the data type of the database backend, not the data types from ODBC documentation.

Example: With my Oracle backend I get data types like "CLOB" and "VARCHAR2" while ODBC only knows SQL_LONGVARCHAR for long character data...
up
0
jorge dot emailNOSPAM at gmail dot com
17 years ago
Here is the complete list!

Access 2003 as the following teturntypes:

COUNTER - Autoincrement
VARCHAR - Text
LONGCHAR - Memo
INTEGER - Number
DATETIME - Date/Time
CURRENCY - Currency
BIT - TRUE/FALSE
LONGBINARY - OLE-Object
LONGCHAR - Hyperlink
DOUBLE - Double Number
BYTE - Byte Number
up
0
not[at]wgpower[dot]net
18 years ago
Some fields can be of the following type too : REAL
To Top