From: nicolasconnault Date: Tue, 5 Feb 2008 10:39:56 +0000 (+0000) Subject: MDL-12158 Applied Matt's patch, merging from 1.9 X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=2c1bfda65e7a51a736d9837cc1959eb48fedf317;p=moodle.git MDL-12158 Applied Matt's patch, merging from 1.9 --- 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;