PHP Connection Host sqlserver2008 Database
In the LAN PHP access host in the sqlserver2008 database, the native Apache configuration is normal, connect the native IP no problem, access to the host database on the error, ask!
The code is as follows:
$dbhost = "
192.168.16.116";//Database host name
$dbuser = "sa";//Database user name
$dbpassword = "MyPwd";//Database Password
$dbname = "Jmsys";//Database name
$conn =mssql_connect ($dbhost, $dbuser, $dbpassword);
if (!mssql_select_db ($dbname, $conn)) {
Die ("SQL ERROR:". $this->db_dbname);
}
$sql = "SELECT top 1 liin_id from Listinfo2";
$result = Mssql_query ($sql, $conn);
$profile = Mssql_fetch_array ($result);
?>
Share to: more
------Solution--------------------
Remote connection requires server-side authorization from sqlserver2005
Connect to native IP no problem, no problem with program and configuration