From 49c81fe0fd7c50540038e5a2cb4cb56aff375b1e Mon Sep 17 00:00:00 2001 From: ethem Date: Thu, 23 Nov 2006 16:22:39 +0000 Subject: [PATCH] We are expecting multiple records, but in debug mode, it gives this error: Error: Turn off debugging to hide this error. SELECT id FROM enrol_authorize WHERE userid = '3' AND courseid = '2' AND status=0(with limits 0, 100) Very strange error in get_record_sql ! --- enrol/authorize/localfuncs.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/enrol/authorize/localfuncs.php b/enrol/authorize/localfuncs.php index 0546fcc636..7929f59880 100644 --- a/enrol/authorize/localfuncs.php +++ b/enrol/authorize/localfuncs.php @@ -31,9 +31,7 @@ function prevent_double_paid($course) { global $CFG, $SESSION, $USER; - $sql = "SELECT id FROM {$CFG->prefix}enrol_authorize - WHERE userid = $USER->id - AND courseid = $course->id "; + $sql = "SELECT id FROM {$CFG->prefix}enrol_authorize WHERE userid = '$USER->id' AND courseid = '$course->id' "; if (empty($CFG->an_test)) { // Real mode $sql .= 'AND status IN('.AN_STATUS_AUTH.','.AN_STATUS_UNDERREVIEW.','.AN_STATUS_APPROVEDREVIEW.')'; @@ -42,9 +40,9 @@ function prevent_double_paid($course) $sql .= 'AND status='.AN_STATUS_NONE; } - if ($rec = get_record_sql($sql)) { + if ($recid = get_field_sql($sql)) { $a = new stdClass; - $a->orderid = $rec->id; + $a->orderid = $recid; $a->url = "$CFG->wwwroot/enrol/authorize/index.php?order=$a->orderid"; redirect($a->url, get_string("paymentpending", "enrol_authorize", $a), '10'); return; -- 2.39.5