To try and clean up a rather overgrown Moodle instance, I'm trying to get a list of all courses with their instructors. Does anyone know of a SQL query that will do this, or a PHP command (or set of commands) that might help me out?
Is it possible to get the User and Course IDs (ie, the `id` fields from the database tables) in the Custom Reports? The end goal is to be able to remove stale courses and users, and we have scripts that will do that, but they need to be given the DB id fields.
Using Custom Reports, the primary keys are not available. I asked for this functionality in the previous tracker application, and it seems to have vanished. The primary keys are critical data for the administrators.
You will need to use My SQL to create a query for the role = instructor with the course and user ids.