Calling a custom profile field in SQL report

Re: Calling a custom profile field in SQL report

дэргэд José Augusto Moraes -
Хариу нийтлэлийн тоо: 3

Hi John;

I use this simple code:

global $USER;
$string = $USER->profile['fieldname'];

Just change the 'fieldname' to the custom field you want to display.

Hope that helps!

José Augusto Moraes-н хариуд

Re: Calling a custom profile field in SQL report

дэргэд Federica Marra -

Dear all, I'm trying to run this sql in Moodle 2.8.5 but it gives me an error message back!

Could someone help me in writing one sql to display a custom user profile field called "Targetgroup" in the shortname?

Thanks!