odbc_field_type
(PHP 4, PHP 5, PHP 7, PHP 8)
odbc_field_type — Datatype of a field
说明
Gets the SQL type of the field referenced by number in the given result identifier.
参数
statement
-
ODBC 结果对象.
field
-
The field number. Field numbering starts at 1.
返回值
Returns the field type as a string, or false
on error.
更新日志
版本 | 说明 |
---|---|
8.4.0 |
statement 现在需要 Odbc\Result
实例;之前需要 resource。
|
+添加备注
用户贡献的备注 5 notes
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.
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.
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...
jorge dot emailNOSPAM at gmail dot com ¶
18 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
备份地址:http://www.lvesu.com/blog/php/function.odbc-field-type.php