安装/配置
PHP 手册

运行时配置

这些函数的行为受 php.ini 的影响。

Unified ODBC Configuration Options
Name Default Changeable Changelog
odbc.default_db * NULL PHP_INI_ALL  
odbc.default_user * NULL PHP_INI_ALL  
odbc.default_pw * NULL PHP_INI_ALL  
odbc.allow_persistent "1" PHP_INI_SYSTEM  
odbc.check_persistent "1" PHP_INI_SYSTEM  
odbc.max_persistent "-1" PHP_INI_SYSTEM  
odbc.max_links "-1" PHP_INI_SYSTEM  
odbc.defaultlrl "4096" PHP_INI_ALL  
odbc.defaultbinmode "1" PHP_INI_ALL  
odbc.default_cursortype "3" PHP_INI_ALL Available as of PHP5.3.0

Note: Entries marked with * are not implemented yet.

有关 PHP_INI_* 常量进一步的细节与定义参见php.ini 配置选项

以下是配置选项的简要解释。

odbc.default_db string

ODBC data source to use if none is specified in odbc_connect() or odbc_pconnect().

odbc.default_user string

User name to use if none is specified in odbc_connect() or odbc_pconnect().

odbc.default_pw string

Password to use if none is specified in odbc_connect() or odbc_pconnect().

odbc.allow_persistent boolean

Whether to allow persistent ODBC connections.

odbc.check_persistent boolean

Check that a connection is still valid before reuse.

odbc.max_persistent integer

The maximum number of persistent ODBC connections per process.

The maximum number of ODBC connections per process, including persistent connections.

odbc.defaultlrl integer

Handling of LONG fields. Specifies the number of bytes returned to variables.

当使用 integer 类型时,其值以字节为度量单位。还可以用简化符号,说明见此 FAQ
odbc.defaultbinmode integer

Handling of binary data.

odbc.default_cursortype integer

Controles the ODBC cursormodel. Possible values are SQL_CURSOR_FORWARD_ONLY, SQL_CURSOR_KEYSET_DRIVEN, SQL_CURSOR_DYNAMIC and SQL_CURSOR_STATIC (default).


安装/配置
PHP 手册