I developed a database abstraction class based off of our rosterdb class. This class works with the new PDO class built into PHP 5.0 The kicker is, the extension for the class, and the supporting extensions for each type of db you will use must to be enabled in php.ini:
- Code: Select all
extension=php_pdo.dll
extension=php_pdo_firebird.dll
extension=php_pdo_informix.dll
extension=php_pdo_mssql.dll
extension=php_pdo_mysql.dll
extension=php_pdo_oci.dll
extension=php_pdo_oci8.dll
extension=php_pdo_odbc.dll
extension=php_pdo_pgsql.dll
extension=php_pdo_sqlite.dll
A few things I found interesting were:
You can get results in anonymous object form with the column names as the attributes of the object for increased performance and ease of use. Another interesting thing is PDO::prepare
variable binding and Prepared statements woot!
Another thing which is really nice is this is natively compatible with (as you can see in the support extensions) most databases!
some other cool stuff PDO supports:
Transactions and auto-commit
stored procedures
3 error handling strategies
"Large Objects (LOBs)"