PHP 매뉴얼
이전 |  | 다음

# LIX. Microsoft SQL Server Functions

# 소개

These functions allow you to access MS SQL Server database.

# 요구 사항

Requirements for Win32 platforms.

The extension requires the MS SQL Client Tools to be installed on the system where PHP is installed. The Client Tools can be installed from the MS SQL Server CD or by copying `ntwdblib.dll` from `\winnt\system32` on the server to `\winnt\system32` on the PHP box. Copying `ntwdblib.dll` will only provide access. Configuration of the client will require installation of all the tools.

Requirements for Unix/Linux platforms.

To use the MSSQL extension on Unix/Linux, you first need to build and install the FreeTDS library. Source code and installation instructions are available at the FreeTDS home page: http://www.freetds.org/

> 참고: In Windows, the DBLIB from Microsoft is used. Functions that return a column name are based on the `dbcolname()` function in DBLIB. DBLIB was developed for SQL Server 6.x where the max identifier length is 30. For this reason, the maximum column length is 30 characters. On platforms where FreeTDS is used (Linux), this is not a problem.

# 설치

The MSSQL extension is enabled by adding extension=php_mssql.dll to `php.ini`.

To get these functions to work, you have to compile PHP with `--with-mssql[=DIR]`, where DIR is the FreeTDS install prefix. And FreeTDS should be compiled using `--enable-msdblib`.

# 런타임 설정

이 함수의 작동은 `php.ini` 설정에 영향을 받습니다.

표 1. MS SQL Server configuration options

Name | Default | Changeable
--- | --- | ---
mssql.allow_persistent | "1" | PHP_INI_SYSTEM
mssql.max_persistent | "-1" | PHP_INI_SYSTEM
mssql.max_links | "-1" | PHP_INI_SYSTEM
mssql.min_error_severity | "10" | PHP_INI_ALL
mssql.min_message_severity | "10" | PHP_INI_ALL
mssql.compatability_mode | "0" | PHP_INI_ALL
mssql.connect_timeout | "5" | PHP_INI_ALL
mssql.timeout | "60" | PHP_INI_ALL
mssql.textsize | "-1" | PHP_INI_ALL
mssql.textlimit | "-1" | PHP_INI_ALL
mssql.batchsize | "0" | PHP_INI_ALL
mssql.datetimeconvert | "1" | PHP_INI_ALL
mssql.secure_connection | "0" | PHP_INI_SYSTEM
mssql.max_procs | "25" | PHP_INI_ALL

For further details and definition of the PHP_INI_* constants see ini_set().

# 리소스 종류

# 상수 정의

이 확장 모듈은 다음의 상수를 정의합니다. 이는 확장 모듈을 PHP에 내장했거나, 실행시에 동적으로 읽어들일 경우에만 사용할 수 있습니다.

`MSSQL_ASSOC` (integer)

`MSSQL_NUM` (integer)

`MSSQL_BOTH` (integer)

`SQLTEXT` (integer)

`SQLVARCHAR` (integer)

`SQLCHAR` (integer)

`SQLINT1` (integer)

`SQLINT2` (integer)

`SQLINT4` (integer)

`SQLBIT` (integer)

`SQLFLT8` (integer)

이전 | 처음으로 | 다음
mime_content_type | 위로 | mssql_bind