知识屋:更实用的电脑技术知识网站
所在位置:首页 > 编程技术 > PHP编程

php 5.3连接 sqlserver数据库

发布时间:2015-05-27 19:23:11作者:知识屋

1.php原有的mssql.dll在5.3以后已经不可用了 因此为了连接mssql数据库需要去微软的官网找sqlsrv.dll等地址如下

 

等文件

 <http://www.zhishiwu.com/kf/ware/vc/"%20target="_blank"%20class="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;">%20sa,%20PWD%20=>%20erinERIN,%20Database%20=>%20tphp%20);$conn%20=%20sqlsrv_connect(%20$strServer,%20$connInfo%20);var_dump(%20$conn%20);if(%20$conn%20){ echo%20success!; $query%20=%20sqlsrv_query(%20$conn,%20'select%20*%20from%20puser'%20); if(%20$query%20===%20false%20) { sqlsrv_close(%20$conn%20); die(%20'empty'); } while(%20$row%20=%20sqlsrv_fetch_array(%20$query,%20SQLSRV_FETCH_ASSOC)) { var_dump(%20$row%20); } sqlsrv_close(%20$conn%20); }else%20{ echo%20fail!; die(%20print_r(%20sqlsrv_errors(),%20true%20));}?>

 

 

(免责声明:文章内容如涉及作品内容、版权和其它问题,请及时与我们联系,我们将在第一时间删除内容,文章内容仅供参考)
收藏
  • 人气文章
  • 最新文章
  • 下载排行榜
  • 热门排行榜