• 首页
  • vue
  • TypeScript
  • JavaScript
  • scss
  • css3
  • html5
  • php
  • MySQL
  • redis
  • jQuery
  • 位置: php 中文手册 -> php 外部扩展库

    ODBC(开放数据库连接)

    ODBC是“开放数据库互联的简称”(Open Database Connectivity)的简称。ODBC是MicroSoft公司提出的应用程序通用编程接口标准,用于对数据库的访问。

    ODBC实际上是一个数据库访问函数库,使应用程序可以直接操纵数据库中的数据。ODBC是基于SQL语言的,是一种在SQL和应用界面之间的标准接口,他解决了嵌入式SQL接口非规范核心,免除了应用软件随数据库的改变而改变的麻烦。ODBC的一个显著优点是,用它生成的程序是与数据库或数据库引擎无关的,为数据库用户和开发人员屏蔽了异构环境的复杂性,提供了数据库访问的统一接口,为应用程序实现与平台的无关性和可移植性提供了基础,因而ODBC获得了广泛的支持和应用。

    安装

    --with-adabas[=DIR]

    Include Adabas D support. DIR is the Adabas base install directory, defaults to/usr/local.

    --with-sapdb[=DIR]

    Include SAP DB support. DIR is SAP DB base install directory, defaults to/usr/local.

    --with-solid[=DIR]

    Include Solid support. DIR is the Solid base install directory, defaults to/usr/local/solid.

    --with-ibm-db2[=DIR]

    Include IBM DB2 support. DIR is the DB2 base install directory, defaults to/home/db2inst1/sqllib.

    --with-empress[=DIR]

    Include Empress support. DIR is the Empress base install directory, defaults to$EMPRESSPATH. This option only supports Empress Version 8.60 and above.

    --with-empress-bcs[=DIR]

    Include"Empress Local Access"support. DIR is the Empress base install directory, defaults to$EMPRESSPATH. This option only supports Empress Version 8.60 and above.

    --with-birdstep[=DIR]

    Include Birdstep support. DIR is the Birdstep base install directory, defaults to/usr/local/birdstep.

    --with-custom-odbc[=DIR]

    Include a user defined ODBC support. The DIR is ODBC install base directory, which defaults to/usr/local. Make sure to define CUSTOM_ODBC_LIBS and have someodbc.hin your include dirs. E.g., you should define following for Sybase SQL Anywhere 5.5.00 on QNX, prior to run configure script:

       CPPFLAGS="-DODBC_QNX -DSQLANY_BUG"
       LDFLAGS=-lunix
       CUSTOM_ODBC_LIBS="-ldblib -lodbc".
    

    --with-iodbc[=DIR]

    Include iODBC support. DIR is the iODBC base install directory, defaults to/usr/local.

    --with-esoob[=DIR]

    Include Easysoft OOB support. DIR is the OOB base install directory, defaults to/usr/local/easysoft/oob/client.

    --with-unixODBC[=DIR]

    Include unixODBC support. DIR is the unixODBC base install directory, defaults to/usr/local.

    --with-openlink[=DIR]

    Include OpenLink ODBC support. DIR is the OpenLink base install directory, defaults to/usr/local. This is the same as iODBC.

    --with-dbmaker[=DIR]

    Include DBMaker support. DIR is the DBMaker base install directory, defaults to where the latest version of DBMaker is installed (such as/home/dbmaker/3.6).

    PHP的 Windows 版本已内建对此扩展的支持。不需要载入额外的扩展来使用这些函数。

    As of PHP 7.0.0, however, Windows users must enablephp_odbc.dllin order to use this extension.

    运行时配置

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

    Unified ODBC Configuration Options
    名字默认可修改范围更新日志
    odbc.default_db *NULLPHP_INI_ALL
    odbc.default_user *NULLPHP_INI_ALL
    odbc.default_pw *NULLPHP_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_ALLAvailable as of PHP 5.3.0