From 502e8e4c30b58e30b50286cc425566ec58a87f24 Mon Sep 17 00:00:00 2001 From: nicolasconnault Date: Tue, 5 Feb 2008 10:38:44 +0000 Subject: [PATCH] MDL-12158 Applied Matt's patch, merging from 1.7 --- lib/dmllib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/dmllib.php b/lib/dmllib.php index 3304ad020e062..e2f6b3c05d7df 100644 --- a/lib/dmllib.php +++ b/lib/dmllib.php @@ -371,7 +371,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;