+ $str = 'SQL = ' . printable($sql) . EOL . 'SQL returned ' . $mesg . EOL;
+
+ logger('dba: ' . $str );
+ }
+ else {
+
+ /**
+ * If dbfail.out exists, we will write any failed calls directly to it,
+ * regardless of any logging that may or may nor be in effect.
+ * These usually indicate SQL syntax errors that need to be resolved.
+ */
+
+ if($result === false) {
+ logger('dba: ' . printable($sql) . ' returned false.');
+ if(file_exists('dbfail.out'))
+ file_put_contents('dbfail.out', printable($sql) . ' returned false' . "\n", FILE_APPEND);