ADOdb

Database Abstraction Layer for PHP

User Tools

Site Tools


v5:database:pdo

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
v5:database:pdo [2020/01/13 13:09] – Add tier2 tag dregadv5:database:pdo [2020/12/06 20:04] – [pdo_firebird] mnewnham
Line 1: Line 1:
 ====== PDO ====== ====== PDO ======
 ~~NOTOC~~ ~~NOTOC~~
-{{tag>tier2}} 
  
 ===== Description ===== ===== Description =====
Line 37: Line 36:
   * It provides true database abstraction, for example, the ADOdb method ''selectLimit()'' provides a true abstraction of the row limiting and offset of all databases. With PDO, you still need to provide the database specific syntax.   * It provides true database abstraction, for example, the ADOdb method ''selectLimit()'' provides a true abstraction of the row limiting and offset of all databases. With PDO, you still need to provide the database specific syntax.
   * In all cases, using native drivers (listed below) provide better functionality, as well as performance, than the equivalent PDO driver. This is true at both the ADOdb and PHP level   * In all cases, using native drivers (listed below) provide better functionality, as well as performance, than the equivalent PDO driver. This is true at both the ADOdb and PHP level
 +
 +
 +===== Setting Construction Parameters =====
 +Certain attributes need to be passed to the [[https://www.php.net/manual/en/pdo.construct.php|PDO Constructor]], for example, changing the error mode. To facilitate this, a PDO specific settable array **'' ADOConnection::pdoOptions ''** is provided:
 +
 +<code php>
 +$db = newAdoConnection('pdo');
 +
 +$db->pdoOptions = [
 +\PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION
 +];
 +
 +$dsnString= 'host=localhost;dbname=employee.fdb';
 +$db->connect('firebird:' . $dsnString,"SYSDBA", "password");
 +
 +</code>
 +
 ===== The PDO setAttribute function ===== ===== The PDO setAttribute function =====
-As of ADOdb 5.21the PDO::setAttribute() method can be emulated using [[v5:reference:connection:setconnectionparameter|setConnectionParameter()]].+For parameters that are set after the class is instantiatedThe PDO::setAttribute() method can be populated using [[v5:reference:connection:setconnectionparameter|setConnectionParameter()]]. 
 ===== Individual Driver Status ==== ===== Individual Driver Status ====
 ----------------------- -----------------------
Line 222: Line 239:
  
 ==== pdo_firebird ==== ==== pdo_firebird ====
-<WRAP info> 
-This driver is available from version 5.21 
-</WRAP> 
 <WRAP right box round 300px> <WRAP right box round 300px>
 == Native Driver == == Native Driver ==
Line 253: Line 267:
  
 </code> </code>
 +
 +{{tag>tier2}}
 +
v5/database/pdo.txt · Last modified: 2022/02/20 23:47 by mnewnham