Home > Backend Development > PHP Tutorial > PHP uses PDO to connect to the ACCESS database, pdoaccess_PHP tutorial

PHP uses PDO to connect to the ACCESS database, pdoaccess_PHP tutorial

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-07-13 10:05:16
Original
1092 people have browsed it

PHP uses PDO to connect to the ACCESS database, pdoaccess

1, refer to W3CSHOOL

http://www.w3cschool.cc/php/php-pdo.html

2, connect access

Copy code The code is as follows:
$db = new PDO("odbc:driver={microsoft access driver (*.mdb)};
            dbq=".realpath("data.mdb"))
                 or die("Connect Error");
$rs = $db->query('select * from user');
print "

";<br>
print_r($rs->fetchAll());<br>
print "
";

The above is a simple and practical method to connect to the ACCESS database using PDO pdo method. I hope you will like it.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/963848.htmlTechArticlePHP uses PDO to connect to the ACCESS database, pdoaccess 1, refer to W3CSHOOL http://www.w3cschool.cc/php/ php-pdo.html 2. Connect access and copy the code as follows: php $db = new PDO("odbc:driver...
Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template