php教程 access 数据连接与读取保存数据解析
$conn = new com("ADODB.Connection");
$connstr = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=". realpath("www.bkjia.com/db.mdb");
//与access连接要用到com接口了。
$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();
}
//下面来看一下php access数据库教程保存
$sql ="insert into szd_t(title)values('www.bkjia.com')";
$rs->Open( $sql );
echo '保存成功';
//php access数据库编辑
$sql ="Update szd_t set title="php100.com" where id=".$_GET['id'];
$rs->Open( $sql );
echo '编辑成功';
//删除数据
$sql ="delete from szd_t where id=".$_GET['id'];
//本文章原创于www.bkjia.com,转载注明出处
已抢62164个
抢已抢110840个
抢已抢46750个
抢已抢133572个
抢已抢32329个
抢