gabrysiak / pdo-wrapper
PHP PDO wrapper class
dev-master
2013-08-10 17:48 UTC
Requires
- php: >=5.3.0
This package is not auto-updated.
Last update: 2025-06-07 19:08:43 UTC
README
Example Usage:
CONNECT:
$db = new DB("mysql:host=localhost;dbname=db", "dbuser", "dbpass");
ERROR HANDLING:
$db->setErrorCallbackFunction("myErrorHandler");
SELECT:
$result = $db->select('tablename', 'foo = "bar"'); foreach($result as $row) { echo $row['foo']; }
PREPARED SELECT:
$foo = "bar"; $bind = array( ":name" => "$foo" ); $results = $db->select("mytable", "name = :name", $bind, 'first_name, last_name');