diff options
author | Dries Buytaert <dries@buytaert.net> | 2008-10-30 08:57:50 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2008-10-30 08:57:50 +0000 |
commit | 21c24340bc947e8ae07172e7ae599f306775d376 (patch) | |
tree | 23a76d8f45d6b2907ff963c7ece2424a0369b005 /includes/database/database.inc | |
parent | 523d0da8b70595a606ebdcc5d24af478d8c4da00 (diff) | |
download | brdo-21c24340bc947e8ae07172e7ae599f306775d376.tar.gz brdo-21c24340bc947e8ae07172e7ae599f306775d376.tar.bz2 |
- Patch #327460 by chx: some more documentation improvements.
Diffstat (limited to 'includes/database/database.inc')
-rw-r--r-- | includes/database/database.inc | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/includes/database/database.inc b/includes/database/database.inc index 7b66f2441..b44846aa2 100644 --- a/includes/database/database.inc +++ b/includes/database/database.inc @@ -156,7 +156,9 @@ abstract class DatabaseConnection extends PDO { protected $logger = NULL; function __construct($dsn, $username, $password, $driver_options = array()) { - $driver_options[PDO::ATTR_ERRMODE] = PDO::ERRMODE_EXCEPTION; // Because the other methods don't seem to work right. + // Because the other methods don't seem to work right. + $driver_options[PDO::ATTR_ERRMODE] = PDO::ERRMODE_EXCEPTION; + // Call PDO::__construct and PDO::setAttribute. parent::__construct($dsn, $username, $password, $driver_options); $this->setAttribute(PDO::ATTR_STATEMENT_CLASS, array('DatabaseStatement', array($this))); } @@ -273,6 +275,7 @@ abstract class DatabaseConnection extends PDO { static $statements = array(); $query = self::prefixTables($query); if (empty($statements[$query])) { + // Call PDO::prepare. $statements[$query] = parent::prepare($query); } return $statements[$query]; @@ -384,7 +387,8 @@ abstract class DatabaseConnection extends PDO { try { // We allow either a pre-bound statement object or a literal string. - // In either case, we want to end up with an executed statement object. + // In either case, we want to end up with an executed statement object, + // which we pass to PDOStatement::execute. if ($query instanceof DatabaseStatement) { $stmt = $query; $stmt->execute(NULL, $options); @@ -1306,6 +1310,7 @@ class DatabaseStatement extends PDOStatement { * A single field from the next record. */ public function fetchField($index = 0) { + // Call PDOStatement::fetchColumn to fetch the field. return $this->fetchColumn($index); } @@ -1320,6 +1325,7 @@ class DatabaseStatement extends PDOStatement { * An associative array. */ public function fetchAssoc() { + // Call PDOStatement::fetch to fetch the row. return $this->fetch(PDO::FETCH_ASSOC); } } |