loading....

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

参考URL  https://docs.moodle.org/29/en/Installing_MSSQL_for_PHP#Using_FreeTDS_on_Debian_Lenny

第一步,下载相应的dll

PHP versionThread SafeFreeTDS versionDownload URL
PHP 5.2.x (vc6) Yes 0.82 + 20090302 patches Download!
No 0.82 + 20090302 patches Download!
PHP 5.3.x (vc6) Yes 0.82 + 20090904 patches (unconfirmed) Download!
No 0.82 + 20090904 patches (unconfirmed) Download!
PHP 5.3.x (vc9) Yes 0.82 + 20090904 patches Download!
No 0.82 + 20090904 patches Download!

第二步,在php.ini中增加extension=php_dblib.dll

第三步,重启IIS

示例代码,测试一下连接是否正常

<?php
    $link = mssql_connect('localhost', 'db_user', 'db_password');
    if(!$link) {
        echo'Could not connect';
        die('Could not connect: ' . mssql_error());
    }
    echo'Successful connection';
    mssql_close($link);
?>

 

posted on 2015-06-23 13:57  程序加载中  阅读(365)  评论(0编辑  收藏  举报