Home  >  Article  >  Backend Development  >  How to connect and configure php with mssql database_PHP tutorial

How to connect and configure php with mssql database_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 17:04:231017browse

php tutorial how to connect and configure with mssql database tutorial
The extension php_mssql.dll that comes with PHP connects to SQL Server 2000 and uses the mssql series of functions to operate, the same as operating MySQL.

1. 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.

4. Restart Apache, OK

*/
//Use mssql_connect

$conn=mssql_connect('localhost','pandao','1987') or die('bKjia.c0m database cannot be connected');
mssql_select_db('test',$conn);
//query statement
$Query="select * from news";
$AdminResult=mssql_query($Query);
//Output results
$Num=mssql_num_rows($AdminResult);
for($i=0;$i<$Num;$i++)
{
$Row=mssql_fetch_array($AdminResult);
echo($Row[1]);
echo("
");
}

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/630854.htmlTechArticlephp tutorial how to connect and configure the extension php_mssql.dll that comes with PHP to connect to SQL Server 2000, use The mssql series functions are operated in the same way as MySQL. 1. Open PH...
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