PDO_DBLIB DSN

(No version information available, might be only in CVS)

PDO_DBLIB DSN — Connecting to Microsoft SQL Server and Sybase databases

Описание

The PDO_DBLIB Data Source Name (DSN) is composed of the following elements:

DSN prefix

The DSN prefix is sybase: if PDO_DBLIB was linked against the FreeTDS libraries, mssql: if PDO_DBLIB was linked against the Microsoft SQL Server libraries, or dblib: if linked against any other variety of DB-lib.

host

The hostname on which the database server resides.

dbname

The name of the database.

Примеры

Пример #1 PDO_DBLIB DSN examples

The following examples show a PDO_DBLIB DSN for connecting to Microsoft SQL Server and Sybase databases:

mssql:host=localhost;dbname=testdb
sybase:host=localhost;dbname=testdb
dblib:host=localhost;dbname=testdb

Коментарии

when you connect to non standart 1433 port

for win32 use DSN like 'mssql:host=hostname,port;dbname=database'

for FreeTDS and DB-Lib use DSN like  'mssql:host=hostname:port;dbname=database'
2009-02-04 04:11:34
http://php5.kiev.ua/manual/ru/ref.pdo-dblib.connection.html
If you're using FreeTDS driver and you want to use "charset" parameter then you may have to edit freetds.conf (e.g. /etc/freetds/freetds.conf) and force connection using at least version 7.0 of the protocol.

tds version = 7.0

Charset parameter accepts all encodings supported by iconv (execute iconv --list to show all encodings).
2013-05-10 11:22:08
http://php5.kiev.ua/manual/ru/ref.pdo-dblib.connection.html
Автор:
Instead of specifying tds version and client charset in freetds.conf, you may pass it as a parameter.
<?php $dsn 'dblib:version=7.0;charset=UTF-8;host=domain.example.com;dbname=example;'?>
2016-01-14 18:57:29
http://php5.kiev.ua/manual/ru/ref.pdo-dblib.connection.html

    Поддержать сайт на родительском проекте КГБ