In my previous post, i have connection Yii with Oracle, then, when i move to my new office, they use sql server for database. It is almost the same as connection with oracle. Here we go,

  1. you must install sql client server, i use windows 7 and it need sql client server 2012. 
  2. download php_pdo_sqlsrv_54_nts.dll, php_pdo_sqlsrv_54_ts.dll, php_pdo_sqlsrv_53_nts.dll, php_pdo_sqlsrv_53_ts.dll. if u use php 5.4 then paste 54 or php 5.3 then paste 53 file. Then paste all the files into xampp\php\ext\, 
  3. then edit php.ini, like this : 
      extension=php_sqlsrv_54_ts.dll
      extension=php_pdo_sqlsrv_54_ts.dll


    4. restart apache..
    5. configure the yii files : protected\config\main.php like this :

             db'=>array(
            'connectionString' => 'sqlsrv:Server=LOCALHOST;Database=CPPermata',
            'username' => 'sa',
            'password' => 'sa1234',
            'charset' => 'GB2312',
        ),


then you can generate model by gii.. :D


This entry was posted on 4/26/2013 02:49:00 AM and is filed under . You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

0 komentar: