我試圖從PHP通過「調用未定義功能sqlsrv_connect()」 試圖從PHP
$connectionInfo = array("UID" => "[email protected]", "pwd" => "xxx", "Database" => "xxx");
$serverName = "tcp:xxx.database.windows.net,1433";
$conn = sqlsrv_connect($serverName, $connectionInfo);
連接到Azure的數據庫,但它給了我
致命錯誤:調用未定義功能sqlsrv_connect()在C:\ WAMP \ WWW \的index.php上線19
爲什麼不先快速Google,找到[this](http://msdn.microsoft.com/en-us/library/windowsazure/ff394110.aspx)或[this?](http:// blogs.msdn.com/b/brian_swan/archive/2010/02/12/getting-started-with-php-and-sql-azure.aspx) –
好的......謝謝。但現在它說「致命錯誤:調用未定義的函數sqlsrv_connect()in ...」,顯然我的PHP缺少一些擴展。 – Roger
是的,你需要[SQL服務器擴展](http://www.php.net/manual/en/book.sqlsrv.php)。在Windows上,雖然很容易添加,但通常只需要在php.ini中啓用適當的DLL(請參閱「安裝」一章)。 –