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['Order_ID']; } else { echo "connent Mssql Error!"; }
Possible reasons for connection failure:
(1) The firewall in windows does not allow sql server2000:
(2) php.ini required Add
extension=mssql.so