]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-12158 Applied Matt's patch, merging from 1.9
authornicolasconnault <nicolasconnault>
Tue, 5 Feb 2008 10:39:56 +0000 (10:39 +0000)
committernicolasconnault <nicolasconnault>
Tue, 5 Feb 2008 10:39:56 +0000 (10:39 +0000)
lib/dmllib.php

index 51885e59942d97f816f1f3751a6ce90057e36a82..bb1ad9c14b4f89b506cad8138fd7f9462e29da49 100644 (file)
@@ -384,7 +384,7 @@ function count_records_select($table, $select='', $countitem='COUNT(*)') {
 function count_records_sql($sql) {
     $rs = get_recordset_sql($sql);
 
-    if ($rs) {
+    if (is_object($rs) and is_array($rs->fields)) {
         return reset($rs->fields);
     } else {
         return 0;