..."/> ...">

Home  >  Article  >  Backend Development  >  linux php connect sql server2000

linux php connect sql server2000

巴扎黑
巴扎黑Original
2016-11-12 10:36:091541browse

Connect php to sqlserver2000 in linux

Connection code:

Php code

<?php  
$mssql=mssql_connect("192.168.0.104","sa","123456");  
  
if ($mssql) {  
  
        echo "Connent Mssql Succeed<br />";  
        mssql_select_db("jj2011");  
        $sql="select * from dbo.orders";  
        $queryuser = mssql_query($sql);  
        $rowuser = mssql_fetch_assoc($queryuser);  
        echo $rowuser[&#39;Order_ID&#39;];  
}  
  
else {  
        echo "connent Mssql Error!";  
}

Possible reasons for connection failure:

(1) The firewall in windows does not allow sql server2000:

linux php connect sql server2000

(2) php.ini required Add

extension=mssql.so


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn