This article mainly introduces the PHP database link class (pdo+access), the need for friends can refer to the
PHP PDO Access links code as follows: Class Dbhelpclass { private $conn; Private $qxId; private $ret; function __construct () { $path = ". /.. /app_data/sd#f#45g_!. MDB "; $CONSTR = "Driver={microsoft Access DRIVER (*.mdb)}; Dbq= ". Realpath ($path); $this->conn= new PDO (" ODBC: $constr ") or Die (" PD O Connection faild. "); { /* Read/ / function read ($ SQL, $params =array ()) { $bind = $this->conn->prep Are ($sql); $arrKeys =array_keys ($params); foreach ($arrKeys as $row) { $bind->bindvalue (":". $row, $params [$row]); $bind->execute () or Die (' SQL Erro R: '. $sql); $result = $bind->fetchall (); return $result; } /* Add, modify to call this method * * function Edit ($sql, $params =array ()) { $bind = $this->CONN->PR Epare ($sql); $arrKeys =array_keys ($params); foreach ($arrKeys as $row) { &NB Sp $bind->bindvalue (":" $row, $params [$row]); { $a = $bind->execute () or Die (' SQL error '); return $a; } { $DBH =new dbhelpclass ();