Home >Backend Development >PHP Tutorial >PHP 5.3 connection to sqlserver database_PHP tutorial
1.php’s original mssql.dll is no longer available after 5.3. Therefore, in order to connect to the mssql database, you need to go to Microsoft’s official website to find sqlsrv.dll and other addresses as follows
etc. files
喎?http://www.Bkjia.com/kf/ware/vc/" target="_blank" class="keylink">vcD4KPHA+1dK1vdfUvLrKytPDtcRwaHCw5rG+IMi7uvO4tNbGtb1waHDOxLz+vNC1xGV4dNbQPC9wPgo8cD6yotTacGhwLmluabzTyOujujwvcD4KPHA+Jm5ic3A7PC9wP go8cD5bUEhQX1BET19TUUxTUlZdPGJyIC8+CmV4dGVuc2lvbj1waHBfcGRvX3NxbHNydl81M190c192YzkuZGxsPGJyIC8+CltQSFBfU1FMU1JWXTxiciAvPgpleHRlbnNpb249cGhwX3NxbHNy dl81M190c192YzkuZGxsPC9wPgo8cD4mbmJzcDs8L3A+CjxwPtXi0fm7udKqyLexo8Tjtc S7+sb3yc+wstewwctzcWxjbGkuZXhlt/HU8rK7xNzV/bOjway907XEPC9wPgo8cD4mbmJzc Ds8L3A+CjxwPs/C1Ni12Na3yOfPwqO6PC9wPgo8cD5odHRwOi8vbXNkbi5taWNyb3NvZnQuY29tL2VuLXVzL2xpYnJhcnkvY2MyOTYxNzAuYXNweDwvcD4KPHA+Jm5ic3A7PC9wPgo8cD7Rod bQxOO1xMS/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 )); } ?>