From 2c1bfda65e7a51a736d9837cc1959eb48fedf317 Mon Sep 17 00:00:00 2001 From: nicolasconnault Date: Tue, 5 Feb 2008 10:39:56 +0000 Subject: [PATCH] MDL-12158 Applied Matt's patch, merging from 1.9 --- lib/dmllib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/dmllib.php b/lib/dmllib.php index 51885e5994..bb1ad9c14b 100644 --- a/lib/dmllib.php +++ b/lib/dmllib.php @@ -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; -- 2.39.5