Use SQL SERVER 2000, the date format not like: yyyy/mm/dd hh:mm:ss. So I change to use SQL SERVER 2008 EXPRESS.
download PDO MS EXT
Install the Microsoft SQL Server 2008 R2 Native Client
Please read: System Requirements (Microsoft Drivers for PHP for SQL Server)
read the manual, copy .dll to PHP Ext Dir, and enable this EXT in php.ini.
example:
Note: If you are using WAMP use the thread safe (ts) version
// 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
Total 1 comment
I am running WampServer on Win7, and have SQL Server 2005 to connect to, as verified by DOS command:
I installed 'sqlsrv' (i.e. "Microsoft Drivers 3.0 for PHP for SQL Server" found from the link you give above) - which required the 'SQL Native Client' add-on too.
Following the SQLSRV_Help.chm instructions I copied the DLLs into C:\wamp\bin\php\php5.3.13\ext and added the following DLL names in the block of extension definitions in my C:\wamp\bin\apache\apache2.2.22\bin\php.ini (easily edited from WampServer's menu), so that PHP would understand 'sqlsrv' :
A test script had no success logging in with Windows Authentication, because my Apache httpd.exe service was running as user 'SYSTEM' by default. So I changed the service to run as my login id, and it now connects without having to specify user and password in the php file. (Servicing php http requests, Apache will always be connecting as me, even if I put my workstation server online and allow other users to connect via me)
My now functional test script (displays a whole small SQL table in HTML) contains these lines (amongst others) :
I then set about starting a test Yii application, using DOS command yiic webapp appname
Again, no user or password is required. My app's main.php just contains one item in the db array :
This has allowed me to get as far as running gii today, and successfully generating a model for one of my tables.
Leave a comment
Please login to leave your comment.