Home > Backend Development > PHP Tutorial > 程序写在本机上,数据库在公司里的此外一台电脑上(sqlserver2008),本机上不装任何数据库软件的话,程序能不能连接上数据库

程序写在本机上,数据库在公司里的此外一台电脑上(sqlserver2008),本机上不装任何数据库软件的话,程序能不能连接上数据库

WBOY
Release: 2016-06-13 12:07:21
Original
1006 people have browsed it

程序写在本机上,数据库在公司里的另外一台电脑上(sqlserver2008),本机上不装任何数据库软件的话,程序能不能连接上数据库
假如我conn.php中输入这样一行代码并运行
存放数据库的电脑ip:192.168.1.221
$conn = sqlsrv_connect("192.168.1.221",array("Database"=>"databasename","UID"=>'sa',"PWD"=>'pass123'))or die(print_r(sqlsrv_errors()));
然后在地址栏输入localhost/cnn.php请问能连接得上吗

------解决思路----------------------
SQLSTATE 08001 
这是 SQLServer 没有开启远程连接

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