All articles(网络文学目录) All Pictures(图片目录) All Softwares(软件目录)

 
PHP配置链接access数据库_[PHP教程]

Writer: 归海一刀 Article type: Programming skills(编程技巧) Time: 2014/2/10 6:50:30 Browse times: 378 Comment times: 0

PHP配置链接access数据库_[PHP教程]


Head photo

Image
Go homepage
Upload pictures
Write articles

PHP配置链接access数据库_[PHP教程]

首先下载 php-5.1.1-installer.exe

才2M多,刷的就下来了,okok,然后运行,转到D盘吧,一路顺风,点击next。然后建一个目录php,新建文件info.php输入代码:





在iis里数据http://localhost/php/info.php
如果出现一长串的PHP Version 5.1.1等样子的话,恭喜,配置好了。
如图:

新建php/data/db.mdb,建表szd_t,输入点数据吧,如图:

建立文件default.php;输入:

conn = new com("ADODB.Connection");
connstr = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=". realpath("data/db.mdb");

conn->Open(connstr);
rs = new com("ADODB.RecordSet");
rs->Open("select * from szd_t",conn,1,1);
while(! rs->eof) {
f = rs->Fields(1);
echo f->value;
rs->MoveNext();
}
?>

浏览,还打印你刚在数据库的记录,成功成功,哈哈哈,完毕。如图:





There are 0 records,
Comment:
Must be registered users to comment(必须是注册用户才能发表评论)

Disclaimer Privacy Policy About us Site Map
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.