v5:database:pdo
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
v5:database:pdo [2019/12/27 02:10] – [pdo_oci] mnewnham | v5:database:pdo [2022/02/20 23:47] (current) – [Setting Construction Parameters] mnewnham | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== PDO ====== | ====== PDO ====== | ||
~~NOTOC~~ | ~~NOTOC~~ | ||
- | <WRAP right box> | + | |
- | == See Also == | + | |
- | [[http:// | + | |
- | </ | + | |
===== Description ===== | ===== Description ===== | ||
- | This driver supports connections using the standardized [[http:// | + | |
+ | This driver supports connections using the standardized [[http:// | ||
+ | |||
+ | Supported | ||
^PHP Driver^Description^ADOdb Connector^ | ^PHP Driver^Description^ADOdb Connector^ | ||
Line 17: | Line 17: | ||
|pdo_sqlsrv|SQL Server using Windows Native Client|sqlsrv| | |pdo_sqlsrv|SQL Server using Windows Native Client|sqlsrv| | ||
+ | <WRAP important> | ||
+ | Note that the //pdo// driver cannot be used on its own. It is a technical component that is used internally by the above drivers. | ||
+ | </ | ||
+ | |||
+ | |||
===== Establishing A Connection ===== | ===== Establishing A Connection ===== | ||
To establish a connection, the **//DSN//** style of connection must be used, the first argument of the DSN string being the database type, e.g. to connect to a MySQL database: | To establish a connection, the **//DSN//** style of connection must be used, the first argument of the DSN string being the database type, e.g. to connect to a MySQL database: | ||
Line 34: | Line 39: | ||
===== Preferred Drivers ===== | ===== Preferred Drivers ===== | ||
- | In all cases, using native drivers (listed below) provide better functionality, | + | |
+ | Using ADOdb effectively eliminates the need to use the PHP PDO driver as it hides the PHP level command: | ||
+ | |||
+ | * It provides true database abstraction, | ||
+ | * In all cases, using native drivers (listed below) provide better functionality, | ||
+ | |||
+ | |||
+ | ===== Setting Construction Parameters ===== | ||
+ | Certain attributes need to be passed to the [[https:// | ||
+ | |||
+ | <code php> | ||
+ | $db = newAdoConnection(' | ||
+ | |||
+ | $db-> | ||
+ | \PDO:: | ||
+ | ]; | ||
+ | |||
+ | $dsnString= ' | ||
+ | $db-> | ||
+ | |||
+ | </ | ||
===== The PDO setAttribute function ===== | ===== The PDO setAttribute function ===== | ||
- | As of ADOdb 5.21, the PDO:: | + | For parameters that are set after the class is instantiated, The PDO:: |
===== Individual Driver Status ==== | ===== Individual Driver Status ==== | ||
----------------------- | ----------------------- | ||
Line 86: | Line 113: | ||
---------------------------------------------- | ---------------------------------------------- | ||
==== pdo_oci ==== | ==== pdo_oci ==== | ||
- | |||
- | |||
<WRAP right box round 300px> | <WRAP right box round 300px> | ||
== Preferred Driver == | == Preferred Driver == | ||
Line 94: | Line 119: | ||
^Driver Name|pdo| | ^Driver Name|pdo| | ||
^Data Provider|pdo| | ^Data Provider|pdo| | ||
- | ^Status|Active((This driver is supported by ADOdb project members)| | + | ^Status|Active((This driver is supported by ADOdb project members))| |
^Windows|Yes| | ^Windows|Yes| | ||
^Unix|Yes| | ^Unix|Yes| | ||
Line 102: | Line 127: | ||
== Limitations == | == Limitations == | ||
- | - There id no support for the complex binding features available in the Native Driver | + | |
- | - Some MetaFunctions are unavailable | + | * There is no support for the complex binding features available in the Native Driver |
+ | | ||
---------------------------------------- | ---------------------------------------- | ||
Line 199: | Line 225: | ||
* Dates are always returned as strings | * Dates are always returned as strings | ||
* Most // | * Most // | ||
- | * [[v5: | + | * [[v5: |
* This driver can also be used on Linux platforms, beginning with PHP Version 7. The program relies on the Microsoft drivers for Linux. For more information, | * This driver can also be used on Linux platforms, beginning with PHP Version 7. The program relies on the Microsoft drivers for Linux. For more information, | ||
+ | * You cannot change the character set in the driver. This is a limitation of the PDO driver, not ADOdb | ||
+ | * No support for parameter binding | ||
---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ||
Line 219: | Line 247: | ||
==== pdo_firebird ==== | ==== pdo_firebird ==== | ||
- | <WRAP info> | ||
- | This driver is available from version 5.21 | ||
- | </ | ||
<WRAP right box round 300px> | <WRAP right box round 300px> | ||
== Native Driver == | == Native Driver == | ||
Line 250: | Line 275: | ||
</ | </ | ||
+ | |||
+ | {{tag> | ||
+ |
v5/database/pdo.1577409017.txt.gz · Last modified: 2019/12/27 02:10 by mnewnham