Php tutorial access data connection and read and 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 required for connecting to access.
$ Conn-> Open ($ connstr );
$ Rs = new com ("ADODB. RecordSet ");
// Query and display data
$ Rs-> Open ("select * from szd_t", $ conn, 1, 1 );
While (! $ Rs-> eof ){
$ F = $ rs-> Fields (1 );
Echo $ f-> value;
$ Rs-> MoveNext ();
}
// The following describes how to save the php access Database tutorial.
$ SQL = "insert into szd_t (title) values ('www .bkjia.com ')";
$ Rs-> Open ($ SQL );
Echo 'saved successfully ';
// Edit the php access Database
$ SQL = "Update szd_t set title =" php100.com "where id =". $ _ GET ['id'];
$ Rs-> Open ($ SQL );
Echo 'edited successfully ';
// Delete data
$ SQL = "delete from szd_t where id =". $ _ GET ['id'];
// This article was originally published at www.bkjia.com and is reproduced with the source