* These usually indicate SQL syntax errors that need to be resolved.
*/
- if($result === false) {
+ if(isset($result) AND ($result === false)) {
logger('dba: ' . printable($sql) . ' returned false.' . "\n" . $this->error);
if(file_exists('dbfail.out'))
file_put_contents('dbfail.out', datetime_convert() . "\n" . printable($sql) . ' returned false' . "\n" . $this->error . "\n", FILE_APPEND);
}
- if(($result === true) || ($result === false))
+ if(isset($result) AND (($result === true) || ($result === false)))
return $result;
if ($onlyquery) {
}
}
+ /**
+ * Checks if $array is a filled array with at least one entry.
+ *
+ * @param $array mixed A filled array with at least one entry
+ * @return Whether $array is a filled array
+ */
+ public function is_result ($array) {
+ return (is_array($array) && count($array) > 0);
+ }
+
function __destruct() {
if ($this->db)
\DDDBL\disconnect();