程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 編程語言 >> 網頁編程 >> PHP編程 >> 關於PHP編程 >> php 5.3連接 sqlserver數據庫

php 5.3連接 sqlserver數據庫

編輯:關於PHP編程

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 )); } ?>

 

 

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved