PHP Tutorial Access data connection and read save data parsing
$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 to the access.
$conn->open ($CONNSTR);
$rs = new COM ("ADODB. RecordSet ");
The data is queried and displayed.
$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 Save
$sql = "INSERT into szd_t (title) VALUES (' www.bkjia.com ')";
$rs->open ($sql);
Echo ' Save success ';
PHP Access database editing
$sql = "Update szd_t set title=" php100.com "where id=". $_get[' id '];
$rs->open ($sql);
Echo ' editing success ';
Delete data
$sql = "Delete from szd_t where id=". $_get[' id '];
This article is original in www.bkjia.com, reproduced annotated source
http://www.bkjia.com/PHPjc/444945.html www.bkjia.com true http://www.bkjia.com/PHPjc/444945.html techarticle PHP Tutorial Access data connection with read save data parsing $conn = new COM (ADODB. Connection); $connstr = Driver={microsoft Access DRIVER (*.mdb)}; Dbq=. Realpath (Www.bkjia.com/db.mdb ...