php串連mssql的有關問題 Warning: mssql_connect() [function.mssql-connect]

來源:互聯網
上載者:User
php串連mssql的問題 Warning: mssql_connect() [function.mssql-connect]:
我在IIS下面配置好了PHP5
但是總是出現串連不上Mssql的提示。
我的測試程式如下:

$con=mssql_connect( "localhost", "sa ", "123456 ") or die ('error');

?>

錯誤提示
Warning: mssql_connect() [function.mssql-connect]: Unable to connect to server: $sa in D:\php\2.php on line 11
error

怎麼回事啊 ! 網上的方法我都用啦!php也配置好啦,分號也去掉啦,兩個檔案也放到system32下啦!
急用! 謝謝啦!

------解決方案--------------------
"sa ", "123456 "

空格去掉試試,,不對,列印出錯誤號碼看看
------解決方案--------------------
,連不上的時候mssql_get_last_message(),應該有資訊吧
------解決方案--------------------
不懂,但是把沒用的空格去掉試試吧,你sa後面有空格,123456後面也有,localhost前面的"前面也有,去掉了試試吧
PHP code
$con=mssql_connect("localhost", "sa", "123456") or die ('error');
------解決方案--------------------
你配置好以後,運行phpinfo();如果裡面有MSSQL的話,你得要安裝sql資料庫到你的電腦上面然後啟動sql管理器在試試可能連結上;
如果還是沒有串連上,我給你一個我自己的連結mssql的php類庫給你使用http://download.csdn.net/source/2691449
------解決方案--------------------
把解決方案帖出來啊,我也是這問題
------解決方案--------------------
應該是SQL server配置有問題
  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.