]> andersk Git - sql-web.git/blobdiff - lib/joe.lib.php
bug: dropping database outside the interface stops interface for all users
[sql-web.git] / lib / joe.lib.php
index 24842377377fb298905fb259f7ce5a215903ae0e..0bf1fb034a21da6178ebc1383827eb6597b024d3 100755 (executable)
@@ -68,6 +68,8 @@ function sessTime($query=null) {
 
   if (is_null($query)) {
     $timings[$key]['time'] = microtime(true)-$timings[$key]['time'];
+       if (mysql_error())
+               $timings[$key]['error'] = mysql_error();
     return true;
   } else {
     $timings[$key] = array();
@@ -105,13 +107,20 @@ function fetchRows($rs, $key = null) {
     }
 }
 
-function printErrors($errArray) {
-    if (isset($errArray) && count($errArray)) {
-        echo '<ul style="color:red;">';
-        foreach($errArray as $err) {
-            echo '<li style="color:red;"><p>',$err,'</p></li>';
+function printErrors($err) { printList('err', $err); }
+function printMsgs($err) { printList('msg', $err); }
+
+function printList($class,$err) {
+    if (is_array($err) && count($err)) {
+        echo '<div class="',$class,'">',(count($err)>1?'<ul>':'');
+        foreach($err as $e) {
+                       if (count($err)>1) {
+                               echo '<li><p>',$e,'</p></li>';
+                       } else {
+                               echo '<p>',$e,'</p>';
+                       }
         }
-        echo '</ul>';
+        echo (count($err)>1?'</ul>':''),'</div>';
     }
 }
 
This page took 0.044792 seconds and 4 git commands to generate.