global $CFG, $db;
+ if (empty($db)) {
+ return false;
+ }
+
if (defined('MDL_PERFDB')) { global $PERF ; $PERF->dbqueries++; };
if ($limitfrom || $limitnum) {
global $db, $CFG, $empty_rs_cache;
+ if (empty($db)) {
+ return false;
+ }
+
/// DIRTY HACK: Implement one cache to store meta data (needed by Oracle inserts)
/// TODO: Possibly make it global to benefit other functions needing it (update_record...)
if (!isset($metadatacache)) {