config Use MS SQL SERVER 2005 2008.

Use SQL SERVER 2000, the date format not like: yyyy/mm/dd hh:mm:ss. So I change to use SQL SERVER 2008 EXPRESS.

  1. download PDO MS EXT

  2. Install the Microsoft SQL Server 2008 R2 Native Client

Please read: System Requirements (Microsoft Drivers for PHP for SQL Server)

  1. read the manual, copy .dll to PHP Ext Dir, and enable this EXT in php.ini.

example:

  • PHP 5.3.5 use: [php_pdo_sqlsrv_53_ts_vc6.dll] [php_sqlsrv_53_ts_vc6.dll]
  • PHP 5.3.6 use: [php_pdo_sqlsrv_53_ts_vc9.dll] [php_sqlsrv_53_ts_vc9.dll]

Note: If you are using WAMP use the thread safe (ts) version

  1. Update your web main config. like this.
// PDO MSSQL
'db'=>array(
   // 'class'=>'application.components.MyMsSqlConnection', 

   // old MS PDO + MSSQL 2000:  
   //'connectionString' => 'mssql:host=HOSTNAME\SQLEXPRESS;dbname=Client',

   // new MS PDO + MSSQL 2005 2008
   'connectionString' => 'sqlsrv:Server=HOSTNAME\SQLEXPRESS;Database=Client',
      'username' => 'sa',
      'password' => '111',
      'charset' => 'GB2312',
      'tablePrefix' => 'tbl_',
),
		

I love YII

my site www.WinPowerAssistant.com

3 0
8 followers
Viewed: 75 999 times
Version: 1.1
Category: Tutorials
Written by: vcxz_1982
Last updated by: Asgaroth
Created on: May 11, 2011
Last updated: 12 years ago
Update Article

Revisions

View all history