Home >Backend Development >PHP Tutorial >PHP connection mssql database configuration and demonstration code_PHP tutorial

PHP connection mssql database configuration and demonstration code_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 17:05:151095browse

Open the PHP configuration file php.ini, find;extension=php_mssql.dll and remove the semicolon in front. 2. Find mssql.secure_connection = Off and change it to mssql.secure_connection = On. 3. Copy the two files php_mssql.dll and ntwdblib.DLL in the PHP folder to the C:windowssystem32 folder.

php tutorial connect mssql database tutorial configuration and demonstration code
/*
Open the php configuration file php.ini, find;extension=php_mssql.dll and remove the semicolon in front.
2. Find mssql.secure_connection = off and change it to mssql.secure_connection = on.
3. Copy the two files php_mssql.dll and ntwdblib.dll in the php folder to the c:windowssystem32 folder
----Here, copying ntwdblib.dll to c:windowssystem32 failed because the dll file already exists in this directory.

I restart apache,

*/
$hostname="10.4.250.20";
$dbuser="hr";
$dbpasswd="946138";
$dbname="hr";
$conn = mssql_connect($hostname,$dbuser,$dbpasswd) or die("Database connection error!");
mssql_select_db($dbname,$conn);
$sql = " select * from pip_staff_s where cstaffid ='z797' ";
$rowset=mssql_query($sql,$conn);
$rowcnt=mssql_num_row($rowset);
echo " rows ";
echo $rowset;
echo " end ";

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/630793.htmlTechArticleOpen the PHP configuration file php.ini, find; extension=php_mssql.dll and remove the preceding semicolon. 2. Find mssql.secure_connection = Off and change it to mssql.secure_connection = On. 3. Write PHP files...
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