Fetchmode needs to be explicity set to ASSOC. Plus 1 missing library
added. MDL-7443 Merged from MOODLE_17_STABLE
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user