当前位置:网络资源中心文章中心网络编程PHP教程 → 文章内容

PHP链接ACCESS数据库最简单的方法 (1)

减小字体 增大字体 作者:阿辉  来源:0423tv.com  发布时间:2008-5-16 9:07:25
%26lt;?
$dbc=new com("adodb.connection");
$dbc-%26gt;open("driver=microsoft access driver (*.mdb);dbq=c:\member.mdb");
$rs=$dbc-%26gt;execute("select * from tablename");
$i=0;
while (!$rs-%26gt;eof){
$i+=1
$fld0=$rs-%26gt;fields["UserName"];
$fld0=$rs-%26gt;fields["Password"];
....
echo "$fld0-%26gt;value $fld1-%26gt;value ....";
$rs-%26gt;movenext();
}
$rs-%26gt;close();
?%26gt;