Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added DB::query() that returns a PDOStatement object to fetch items w…

…hile keeping memory usage low
  • Loading branch information...
commit bfcd3ca1acd88ea5769652c4ca2fb6f83b1284c1 1 parent 92b14f6
@jbroadway authored
Showing with 15 additions and 0 deletions.
  1. +15 −0 lib/DB.php
View
15 lib/DB.php
@@ -279,6 +279,21 @@ public static function execute () {
return false;
}
}
+
+ /**
+ * Execute a query and return the PDO statement object
+ * so you can minimize memory usage.
+ */
+ public static function query () {
+ try {
+ list ($stmt, $args) = self::prepare (func_get_args ());
+ $stmt->execute ($args);
+ return $stmt;
+ } catch (Exception $e) {
+ self::$error = $e->getMessage ();
+ return false;
+ }
+ }
/**
* Fetch a single object.
Please sign in to comment.
Something went wrong with that request. Please try again.