php联接 主机 sqlserver2008数据库

WBOY
Release: 2016-06-13 12:31:03
Original
957 people have browsed it

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


  
    
    
  
序号




Related labels:
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