php tutorial access data connection and reading and saving data analysis
$conn = new com("ADODB.Connection");
$connstr = "DRIVER={Microsoft Access Driver (*.mdb )}; DBQ=". realpath("www.bkjia.com/db.mdb");
//The com interface is used to connect with access.
$conn->Open($connstr);
$rs = new com("ADODB.RecordSet");
//Data query and display
$rs->Open( "select * from szd_t",$conn,1,1);
while(! $rs->eof) {
$f = $rs->Fields(1);
echo $ f->value;
$rs->MoveNext();
}
//Let’s take a look at the php access database tutorial to save
$sql ="insert into szd_t(title)values('www.bkjia.com')";
$rs->Open( $sql );
echo 'save successfully';
/ /php access database editing
$sql ="Update szd_t set title="php100.com" where id=".$_GET['id'];
$rs->Open ( $sql );
echo 'edit successfully';
//Delete data
$sql ="delete from szd_t where id=".$_GET['id'];
//This article was originally published on www.bkjia.com, please indicate the source when reprinting