Home > Backend Development > PHP Tutorial > PHP connection to mssql database and configuration method_PHP tutorial

PHP connection to mssql database and configuration method_PHP tutorial

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-07-13 17:04:56
Original
798 people have browsed it

php connection to mssql database and configuration method Now let me tell you how to connect php to mssql database and configure php mssql, so if you are a beginner, this article can give you a tutorial from configuring mssql to letting php connect to mssql database.

php tutorial connecting mssql database tutorial and configuration method
Now let me tell you how to connect php to mssql database and configure php mssql, so if you are a beginner, this article can give you a tutorial from configuring mssql to letting php connect to mssql database.
*/
//Link database

$localhost ='127.0.0.1';//mssql database ip
$sa ='sa';//mssql login username
$pwd='123';//Connection password
$db = 'cs';//Database
$conn=mssql_connect($localhost,$sa,$pwd) or die('mssql database connection failed');
mssql_select_db($db,$conn);//The database for the selection operation is the same as the mysql tutorial
//query statement
$query="select * from vc";
$adminresult=mssql_query($query) or die('sql'.$query);
//Output results

while( $rs = mssql_fetch_array( $adminresult ) )
{
echo $rs['0'];
}

/*
Things to note

1. Open php.in and remove the comment symbol of extension=php_mssql.dll.

2. Open php.in and change mssql.secure_connection = off to on.

3. Copy php_mssql.dll to the directory specified by extension_dir in php.in or the system system32 directory. (php_mssql.dll is included in the php compressed installation package).

After completing the above steps, you need to restart apache.

Note: In actual use, it was found that if you manually install php to iis through a php compressed file, you must restart the machine and not just iis.

4. You need to ensure that there is ntwdblib.dll under php or system32. Check the properties to ensure that its version is 8.00.194 and not 7.0

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/630825.htmlTechArticlephp connection to mssql database and configuration methods. Now I will tell you how to connect php to mssql database and configure php mssql. , so if you are a beginner, this article can allow you to configure...
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
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template