How to get user's data from moodle base?

How to get user's data from moodle base?

by Salome Tkhilaishvili -
Number of replies: 2

I want to get user's data by it's id  and also which courses he/she was enrolled and

how did he/she succeded in his/her exam, I should like to know  which tables should i use?

i know only mdl_users table.

my current moodle version ins 3.5

Average of ratings: -
In reply to Salome Tkhilaishvili

Re: How to get user's data from moodle base?

by Joost Elshoff -
Picture of Particularly helpful Moodlers Picture of Testers

Hi Salome,

That can be done, but requires more knowledge of the Moodle database structure in SQL. If you have installed the Moodle Adminer plugin, you can see all the other tables available.

It does take some advanced SQL knowledge to create the query you're looking for. 

You'd need the following tables, among others:

  • mdl_course
  • mdl_user
  • mdl_enrol
  • mdl_grade_grades


Average of ratings: Useful (2)