Two tickets resolved (57/89)
[mailer.git] / inc / db / lib-mysql3.php
index 58bdc436b241c7b869fadfe1709d57d813c18dc1..61d9be17fa1305e720669059823f380a1851389e 100644 (file)
@@ -90,7 +90,7 @@ Query string:<br />
        } // END - if
 
        // Count DB hits
-       if (getConfig('db_hits_run') == null) {
+       if (!isConfigEntrySet('db_hits_run')) {
                // Count in dummy variable
                setConfigEntry('db_hits_run', 1);
        } else {
@@ -103,7 +103,7 @@ Query string:<br />
 }
 
 // SQL num rows
-function SQL_NUMROWS($result) {
+function SQL_NUMROWS ($result) {
        // Is the result a valid resource?
        if (is_resource($result)) {
                // Get the count of rows from database
@@ -266,9 +266,13 @@ function SQL_QUERY_ESC ($qstring, $data, $file, $line, $run=true, $strip=true) {
        // Was the eval() command fine?
        if ($query == "failed") {
                // Something went wrong?
-               print "eval=".htmlentities($eval)."<pre>";
-               debug_print_backtrace();
-               die("</pre>");
+               printf("eval=%s\n<pre>%s</pre>",
+                       htmlentities($eval),
+                       debug_get_printable_backtrace()
+               );
+
+               // Abort further code executions
+               exit;
        } // END - if
 
        if ($run) {