首页 > 开发 > PHP > 正文

php mssql数据库连接代码

2024-05-04 21:59:11
字体:
来源:转载
供稿:网友
  1. $conn=ADONewConnection('odbc_mssql'); 
  2. $conn->PConnect("Driver={SQL Server};Server=DLUT-PCSQLEXPRESS;Database=yuyan;",'zhouhao','950288'); 
  3. $ADODB_FETCH_MODE=ADODB_FETCH_ASSOC; 
  4. $sqlstr='select * from yuyan where ps教程nNo=?'
  5. $rst=$conn->execute($sqlstr,'005'or die('connect error'); 
  6. while(!$rst->EOF) 
  7. //echo $rst->fields['psnName'].'->'.$rst->fields['www.Vevb.com'].''; 
  8. echo 'dajiahao'
  9. $rst->movenext(); 
  10. $rst->close(); 
  11. $conn->close();

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表