Home > Backend Development > PHP Tutorial > linux php connect sql server2000

linux php connect sql server2000

巴扎黑
Release: 2016-11-12 10:36:09
Original
1555 people have browsed it

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!";  
}
Copy after login

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


Related labels:
php
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template