Another thing that you can use to get these data is Moodle API's (when you are outside moodle).
For your request you can get what you want with 'core_enrol_get_users_courses'
Another thing that you can use to get these data is Moodle API's (when you are outside moodle).
For your request you can get what you want with 'core_enrol_get_users_courses'