This class provides a genericized interface to the PHP PDO toolkit. More...
Public Member Functions | |
| __construct ( $inDatabase, $inUser, $inPassword, $inDriver, $inHost, $inPort) | |
| Initializes connection param class members. | |
| preparedRows ($sql, $params=array(), $buffered=true) | |
| preparedStatement ( $sql, $params=array(), $fetchResponse=false, $paramTypes=array()) | |
| Wrapper for preparing and executing a PDOStatement. | |
Public Attributes | |
| $driver_type | |
| The type of PDO driver we are configured for. | |
| $last_insert | |
| This holds the integer ID of the last AUTO_INCREMENT insert. | |
Private Attributes | |
| $_pdo | |
| Internal PDO object. | |
© Copyright 2023-2026, The Great Rift Valley Software Company
LICENSE:
MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Little Green Viper Software Development LLC
This is a PDO abstraction class, derived from the Badger Hardened Baseline Database Component
This supports MySQL and PostgreSQL, including binary parameters and bounded polygon reads.
Definition at line 32 of file LGV_TZ_Lookup_PDO.class.php.
| LGV_TZ_Lookup_PDO::__construct | ( | $inDatabase, | |
| $inUser, | |||
| $inPassword, | |||
| $inDriver, | |||
| $inHost, | |||
| $inPort ) |
Must be called BEFORE any attempts to connect to or query a database. This uses UTF8, as the charset.
Will destroy previous connection (if one exists).
| $inDatabase | database name |
| $inUser | database user |
| $inPassword | database password |
| $inDriver | database server type |
| $inHost | database server host |
| $inPort | database TCP port |
Definition at line 49 of file LGV_TZ_Lookup_PDO.class.php.
References $dsn, and driver_type.
| LGV_TZ_Lookup_PDO::preparedRows | ( | $sql, | |
| $params = array(), | |||
| $buffered = true ) |
Yield rows one at a time and release the cursor, including when a lookup returns before consuming every row. Polygon reads can disable MySQL buffering to avoid retaining every candidate blob. An unbuffered reader must be closed before another query; the finally block drains its cursor and restores the connection mode. PostgreSQL uses single-row fetching on PHP 8.5+, or a server cursor on earlier PHP releases. BYTEA streams are read and closed here, so callers receive the same binary strings on either database.
Definition at line 153 of file LGV_TZ_Lookup_PDO.class.php.
References $options, and driver_type.
Referenced by preparedStatement().
| LGV_TZ_Lookup_PDO::preparedStatement | ( | $sql, | |
| $params = array(), | |||
| $fetchResponse = false, | |||
| $paramTypes = array() ) |
| Exception | thrown if internal PDO exception is thrown |
| $sql | SQL statement to send (with question mark placeholders). |
| $params | Data for the placeholders. Default is an empty array. |
| $fetchResponse | If true (default is false), then a fetch will be done, and a response returned. |
| $paramTypes | Optional zero-based PDO parameter types for positional write parameters. |
Definition at line 89 of file LGV_TZ_Lookup_PDO.class.php.
References driver_type, and preparedRows().
|
private |
Definition at line 34 of file LGV_TZ_Lookup_PDO.class.php.
| LGV_TZ_Lookup_PDO::$driver_type |
Definition at line 36 of file LGV_TZ_Lookup_PDO.class.php.
| LGV_TZ_Lookup_PDO::$last_insert |
Definition at line 38 of file LGV_TZ_Lookup_PDO.class.php.