Hello. I can't understand what I do wrong.
I've created file "test.php" in moodle/testfolder:
<?php
// require_once(dirname(__FILE__).'/config.php';
function my_function() {
global $DB;
$record = $DB->get_record('user', array('id' => 2));
var_dump($record);
}
my_function();
?>
But when I open http://localhost/testfolder/test.php nothing happend. HTTP ERROR 500.
I've tried with require_once or without - same.
Please help.