From db15d4375e3051ac0772bf41c711e7342d47fc6e Mon Sep 17 00:00:00 2001 From: stronk7 Date: Mon, 13 Nov 2006 22:49:30 +0000 Subject: [PATCH] Fetchmode needs to be explicity set to ASSOC. Plus 1 missing library added. MDL-7443 Merged from MOODLE_17_STABLE --- enrol/database/enrol.php | 1 + enrol/database/enrol_database_sync.php | 1 + 2 files changed, 2 insertions(+) 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 -- 2.39.5