OH i see it now, thanks so much Benjamin!
One more thing if you dont mind, I have this
sql query question. I am trying to query a table with all the grades & completion status for scorm. The query keeps failing at the bolded line as below, if i run with without the bolded line, it runs just fine.
I've been reading about the subselect, and i cant seem to figure out what is wrong in the syntax here:
SELECT
mdl_course.idnumber as course_id,
mdl_course.shortname,
mdl_course.category,
mdl_user.id as moodle_id,
mdl_user.username as "NRIC/Passport",
mdl_user.firstname,
mdl_user.lastname,
mdl_user_info_data.data as employer_id,
mdl_scorm.name as scorm_name,
status = (SELECT mdl_scorm_scoes_track.value where mdl_scorm_scoes_track.element='cmi.core.lesson_status'),
mdl_scorm_scoes_track.attempt,
from_unixtime(mdl_scorm_scoes_track.timemodified) as completiondate,
'scorm' as lessontype
FROM mdl_scorm_scoes_track
INNER JOIN mdl_scorm
ON (mdl_scorm.id = mdl_scorm_scoes_track.scormid)
INNER JOIN mdl_user
ON (mdl_scorm_scoes_track.userid = mdl_user.id)
INNER JOIN mdl_course
ON (mdl_course.id = mdl_scorm.course)
INNER JOIN mdl_user_info_data
ON (mdl_user_info_data.userid = mdl_user.id)
WHERE ( mdl_user_info_data.fieldid=5 )