Home  >  Article  >  Backend Development  >  PHP5.2.3 connects to sqlserver2008, sqlserver2008_PHP tutorial

PHP5.2.3 connects to sqlserver2008, sqlserver2008_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 09:56:241093browse

php5.2.3 connects to sqlserver2008, sqlserver2008

1, download the driver

Download address: https://www.microsoft.com/en-us/download/details.aspx?id=20098

What I downloaded is: SQLSRV20.EXE because my php version is 5.2.3. Please see the download instructions for the specific version.

2, decompress SQLSRV20.EXE,

3. Modify php.ini and add extension=php_sqlsrv_52_ts_vc6.dll

4, copy extension=php_sqlsrv_52_ts_vc6.dll

5, restart the server

$server = '(local)';
$user = 'sa';
$pass='sa';
$dbname='testdb';
if(sqlsrv_connect($server, array('UID' => $user ,'PWD'=> $pass, 'Database' => $dbname)))
{
echo "Success ";
}
else
{
echo "Failed";
}
?>

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/988269.htmlTechArticlephp5.2.3 connects sqlserver2008, sqlserver2008 1, download driver download address: https://www.microsoft.com/ en-us/download/details.aspx?id=20098 What I downloaded is: SQLSRV20.EXE, because my...
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