Skip to content

Commit

Permalink
Added some checking that should not be necessary but I had notices in…
Browse files Browse the repository at this point in the history
… one extreme situation
  • Loading branch information
moodler committed Sep 13, 2006
1 parent 0f161e1 commit 3d1885a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/dmllib.php
Original file line number Diff line number Diff line change
Expand Up @@ -593,6 +593,10 @@ function get_recordset_sql($sql, $limitfrom=null, $limitnum=null) {

global $CFG, $db;

if (empty($db)) {
return false;
}

if (defined('MDL_PERFDB')) { global $PERF ; $PERF->dbqueries++; };

if ($limitfrom || $limitnum) {
Expand Down Expand Up @@ -994,6 +998,10 @@ function insert_record($table, $dataobject, $returnid=true, $primarykey='id') {

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)) {
Expand Down

0 comments on commit 3d1885a

Please sign in to comment.