<?php
-// Temporarily removed
-//if(class_exists('\PDO') && in_array('mysql', PDO::getAvailableDrivers())) {
-// require_once("library/dddbl2/dddbl.php");
-// require_once("include/dba_pdo.php");
-//}
+
+# if PDO is avaible for mysql, use the new database abstraction
+if(class_exists('\PDO') && in_array('mysql', PDO::getAvailableDrivers())) {
+ require_once("library/dddbl2/dddbl.php");
+ require_once("include/dba_pdo.php");
+}
require_once('include/datetime.php');
if(($result === true) || ($result === false))
return $result;
-
+
if ($onlyquery) {
- $this->result = $result;
+ $this->result = $r; # this will store an PDOStatement Object in result
+ $this->result->execute(); # execute the Statement, to get its result
return true;
}
}
public function qfetch() {
-
- if (!$this->result)
+
+ if (false === $this->result)
return false;
-
+
return $this->result->fetch();
}
public function qclose() {
if ($this->result)
- $this->result->closeCursor();
+ return $this->result->closeCursor();
}
public function dbg($dbg) {
function dba_timer() {
return microtime(true);
}}
-