ANSI join ON clauses should contain only the join condition. Also,

added prefix to the ORDER BY to prevent duplicate names.
This commit is contained in:
stronk7 2007-10-08 17:42:46 +00:00
parent aa87d82cec
commit 115a43113a

View File

@ -908,9 +908,9 @@ function get_my_courses($userid, $sort='visible DESC,sortorder ASC', $fields=NUL
ctx.id AS ctxid, ctx.path AS ctxpath,
ctx.depth as ctxdepth, ctx.contextlevel AS ctxlevel
FROM {$CFG->prefix}course_categories cc
JOIN {$CFG->prefix}context ctx
ON (cc.id=ctx.instanceid AND ctx.contextlevel=".CONTEXT_COURSECAT.")
ORDER BY id";
JOIN {$CFG->prefix}context ctx ON (cc.id = ctx.instanceid)
WHERE ctx.contextlevel = ".CONTEXT_COURSECAT."
ORDER BY cc.id";
$rs = get_recordset_sql($sql);
// Using a temporary array instead of $cats here, to avoid a "true" result when isnull($cats) further down