]> git.mjollnir.org Git - moodle.git/commitdiff
In execute_sql, if feedback is not required then don't even show the
authormoodler <moodler>
Thu, 18 Nov 2004 03:36:52 +0000 (03:36 +0000)
committermoodler <moodler>
Thu, 18 Nov 2004 03:36:52 +0000 (03:36 +0000)
ADOdb feedback.  Makes those careful DROPs look less frightening!  :-)

lib/datalib.php

index 5d1cf8c8619491c3617e2abfc6dec3017bf2f635..3cc6060f613e9549bcb33b5a93e9f10eeb902efa 100644 (file)
@@ -44,8 +44,16 @@ function execute_sql($command, $feedback=true) {
 
     global $db;
 
+    $olddebug = $db->debug;
+
+    if (!$feedback) {
+        $db->debug = false;
+    }
+
     $result = $db->Execute($command);
 
+    $db->debug = $olddebug;
+
     if ($result) {
         if ($feedback) {
             echo '<p><font color="green"><strong>'. get_string('success') .'</strong></font></p>';