]> andersk Git - sql-web.git/blobdiff - lib/joe.lib.php
is_numeric bug in fetchRows and more
[sql-web.git] / lib / joe.lib.php
index 04c4dc19106ad7f2cb637d36435be7f3c8a67961..d36cef13c84d43025ea0ba9a8d333a071edb1378 100755 (executable)
@@ -1,7 +1,6 @@
 <?php
 /*
     (c) 2005 Joe Presbrey
-    joepresbrey@gmail.com
 
     ATTN:  This library was assembled and completed in its entirety independent of
     any and all corporate projects and/or work environ.
@@ -68,6 +67,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();
@@ -108,13 +109,17 @@ function fetchRows($rs, $key = null) {
 function printErrors($err) { printList('err', $err); }
 function printMsgs($err) { printList('msg', $err); }
 
-function printList($class,$errArray) {
-    if (isset($errArray) && count($errArray)) {
-        echo '<div class="',$class,'"><ul>';
-        foreach($errArray as $err) {
-            echo '<li><p>',$err,'</p></li>';
+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></div>';
+        echo (count($err)>1?'</ul>':''),'</div>';
     }
 }
 
This page took 0.398305 seconds and 4 git commands to generate.