update : 2015.11.03
php.shukuma.com검색:
|
PDO_SQLSRV DSN(No version information available, might only be in Git) PDO_SQLSRV DSN — Connecting to MS SQL Server and SQL Azure databases 설명The PDO_SQLSRV Data Source Name (DSN) is composed of the following elements:
예제
Example #1 PDO_SQLSRV DSN examples The following example shows how to connecto to a specified MS SQL Server database: $c = new PDO("sqlsrv:Server=localhost;Database=testdb", "UserName", "Password"); The following example shows how to connect to a MS SQL Server database on a specified port: $c = new PDO("sqlsrv:Server=localhost,1521;Database=testdb", "UserName", "Password"); The following example shows how to connecto to a SQL Azure database with server ID 12345abcde. Note that when you connect to SQL Azure with PDO, your username will be UserName@12345abcde (UserName@ServerId). $c = new PDO("sqlsrv:Server=12345abcde.database.windows.net;Database=testdb", "UserName@12345abcde", "Password"); |