Home  >  Article  >  Backend Development  >  php联接 主机 sqlserver2008数据库

php联接 主机 sqlserver2008数据库

WBOY
WBOYOriginal
2016-06-13 11:43:04896browse

php连接 主机 sqlserver2008数据库

  在局域网中   php访问 主机中的sqlserver2008数据库     ,本机apache配置正常,连接本机ip没问题,访问主机的数据库就报错,请教!
代码如下:

$dbhost = "192.168.16.116";//数据库主机名
$dbuser = "sa";//数据库用户名
$dbpassword = "mypwd";//数据库密码
$dbname = "jmsys";//数据库名

$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);
?>


  
    
    
  
序号




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