xxxxxxxxxx
SELECT
concat('<a target="_new" href=%%WWWROOT%%/course/view.php?id=',c.id,'">',c.fullname,'</a>') AS Course
,c.shortname,r.name
,(SELECT CONCAT(u.firstname,' ', u.lastname) AS Teacher
FROM prefix_role_assignments AS ra
JOIN prefix_context AS ctx ON ra.contextid = ctx.id
JOIN prefix_user AS u ON u.id = ra.userid
WHERE ra.roleid = 3 AND ctx.instanceid = c.id LIMIT 1) AS Teacher
,concat('<a target="_new" href="%%WWWROOT%%/mod/resource/view.php?id=',r.id,'">',r.name,'</a>') AS Resource
FROM prefix_resource AS r
JOIN prefix_course AS c ON r.course = c.id
WHERE r.reference LIKE 'https://stackoverflow.com/%'
xxxxxxxxxx
Programming is like a "choose your
own adventure game" except every
path leads you to a StackOverflow
question from 2013 describing the
same bug, with no answer.
So, you're searching for the holy grail?
xxxxxxxxxx
https://stackoverflow.com/
Here it is. I hope you dont mind me drinking out of it first
Dont only copy the code, try to understand it!