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,
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
- you must install sql client server, i use windows 7 and it need sql client server 2012.
- 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\,
- then edit php.ini, like this :
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
0 komentar: