欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  php教程

php 5.3连接 sqlserver数据库

程序员文章站 2024-01-24 21:12:04
...
1.php原有的mssql.dll在5.3以后已经不可用了 因此为了连接mssql数据库需要去微软的官网找sqlsrv.dll等地址如下

等文件

喎?http://www.Bkjia.com/kf/ware/vc/" target="_blank" class="keylink">vcD4KPHA+1dK1vdfUvLrKytPDtcRwaHCw5rG+IMi7uvO4tNbGtb1waHDOxLz+vNC1xGV4dNbQPC9wPgo8cD6yotTacGhwLmluabzTyOujujwvcD4KPHA+Jm5ic3A7PC9wPgo8cD5bUEhQX1BET19TUUxTUlZdPGJyIC8+CmV4dGVuc2lvbj1waHBfcGRvX3NxbHNydl81M190c192YzkuZGxsPGJyIC8+CltQSFBfU1FMU1JWXTxiciAvPgpleHRlbnNpb249cGhwX3NxbHNydl81M190c192YzkuZGxsPC9wPgo8cD4mbmJzcDs8L3A+CjxwPtXi0fm7udKqyLexo8TjtcS7+sb3yc+wstewwctzcWxjbGkuZXhlt/HU8rK7xNzV/bOjway907XEPC9wPgo8cD4mbmJzcDs8L3A+CjxwPs/C1Ni12Na3yOfPwqO6PC9wPgo8cD5odHRwOi8vbXNkbi5taWNyb3NvZnQuY29tL2VuLXVzL2xpYnJhcnkvY2MyOTYxNzAuYXNweDwvcD4KPHA+Jm5ic3A7PC9wPgo8cD7RodbQxOO1xMS/serGvcyoscjI53g4NrvyeDY0PC9wPgo8cD4mbmJzcDs8L3A+CjxwPtauuvO+zb/J0tTBrL3TxOO1xHNxbCBzZXJ2ZXLK/b7dv+LByzwvcD4KPHA+yr7A/bT6wuvI58/Co7o8L3A+CjxwPiZuYnNwOzwvcD4KPHByZSBjbGFzcz0="brush:java;"> sa, PWD => erinERIN, Database => tphp ); $conn = sqlsrv_connect( $strServer, $connInfo ); var_dump( $conn ); if( $conn ) { echo success!; $query = sqlsrv_query( $conn, 'select * from puser' ); if( $query === false ) { sqlsrv_close( $conn ); die( 'empty'); } while( $row = sqlsrv_fetch_array( $query, SQLSRV_FETCH_ASSOC)) { var_dump( $row ); } sqlsrv_close( $conn ); } else { echo fail!; die( print_r( sqlsrv_errors(), true )); } ?>

相关标签: php 5 3