From: stronk7 Date: Mon, 13 Nov 2006 22:49:30 +0000 (+0000) Subject: Fetchmode needs to be explicity set to ASSOC. Plus 1 missing library X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=db15d4375e3051ac0772bf41c711e7342d47fc6e;p=moodle.git Fetchmode needs to be explicity set to ASSOC. Plus 1 missing library added. MDL-7443 Merged from MOODLE_17_STABLE --- diff --git a/enrol/database/enrol.php b/enrol/database/enrol.php index 66773f0cab..12e9661567 100644 --- a/enrol/database/enrol.php +++ b/enrol/database/enrol.php @@ -604,6 +604,7 @@ function enrol_connect() { // Try to connect to the external database $enroldb = &ADONewConnection($CFG->enrol_dbtype); if ($enroldb->PConnect($CFG->enrol_dbhost,$CFG->enrol_dbuser,$CFG->enrol_dbpass,$CFG->enrol_dbname)) { + $enroldb->SetFetchMode(ADODB_FETCH_ASSOC); ///Set Assoc mode always after DB connection return $enroldb; } else { // do a bit of cleanup, and lot the problem diff --git a/enrol/database/enrol_database_sync.php b/enrol/database/enrol_database_sync.php index 8d6effbb1d..edeb500b48 100644 --- a/enrol/database/enrol_database_sync.php +++ b/enrol/database/enrol_database_sync.php @@ -9,6 +9,7 @@ require_once(dirname(dirname(dirname(__FILE__))).'/config.php'); // global moodle config file. require_once($CFG->dirroot . '/course/lib.php'); + require_once($CFG->dirroot . '/lib/blocklib.php'); require_once($CFG->dirroot . "/enrol/database/enrol.php"); // ensure errors are well explained