PHP程序在MSSQL中连接 [英] PHP program to connect in MSSQL

查看:49
本文介绍了PHP程序在MSSQL中连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好。!

我一直用PHP(xampp)做一个需要在MSSQL数据库中连接的项目。

我已经完成了下载和安装SQLSRV30.exe在C:\ xampp \ php \ ext文件夹中并创建一个简单程序来确定程序是否已连接或不过但仍然无法弄清楚我遇到的问题。



Hello there.!
I've been doing a project in PHP(xampp) which requires to connect in MSSQL database.
I've already done things like downloading and installing SQLSRV30.exe in "C:\xampp\php\ext" folder and creating a simple program which determine whether the program is already connected or not but still couldn't figure it out the problem that i encountered.

$server = "IDEA-PC\SQLEXPRESS";
	$dbGet = array("Database"=>"LogboxDB");
	$con = sqlsrv_connect($server, $dbGet) or die (sqlsrv_error());
	if(!$con)
	{
		 die(print_r(sqlsrv_errors(), true));
	}
	else
	{
		echo 'Connected';
	}







这是我的错误。

致命错误:调用未定义的函数sqlsrv_connect();

请帮我摆脱这个问题。

谢谢。 GodBless:D




Here is my error.
Fatal error: Call to undefined function sqlsrv_connect();
Please help me to get rid of this problem.
Thanks. GodBless :D

推荐答案

服务器 = IDEA-PC\SQLEXPRESS;
server = "IDEA-PC\SQLEXPRESS";


dbGet = array( 数据库 => LogboxDB);
dbGet = array("Database"=>"LogboxDB");


con = sqlsrv_connect(
con = sqlsrv_connect(


这篇关于PHP程序在MSSQL中连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆