Home > php教程 > php手册 > php mssql数据库连接代码

php mssql数据库连接代码

WBOY
Release: 2016-05-24 18:30:49
Original
1503 people have browsed it

$conn=ADONewConnection('odbc_mssql'); 
$conn->PConnect("Driver={SQL Server};Server=DLUT-PCSQLEXPRESS;Database=yuyan;",'zhouhao','950288'); 
$ADODB_FETCH_MODE=ADODB_FETCH_ASSOC; 
$sqlstr='select * from yuyan where ps教程nNo=?'; 
$rst=$conn->execute($sqlstr,'005') or die('connect error'); 
while(!$rst->EOF) 
{ 
//echo $rst->fields['psnName'].'->'.$rst->fields['www.phprm.com'].''; 
echo 'dajiahao'; 
$rst->movenext(); 
} 
$rst->close(); 
$conn->close();
Copy after login


Related labels:
php
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template