I am trying to query some data from the moodle database. I am using the data manipulation API. Here is my code. When I run it on the browser, i get a blank screen. i reall dont know what the $enrolids is. Is it an associative array or what. Even when I try create an associative array, I still get a blank screen.
<?php
require_once("../config.php");
$userid=$_GET['userid'];
//Get the enrolids from the mdl_user_enrolments table
$enrolids=$DB->get_records_sql('SELECT enrolid FROM {user_enrolments} WHERE userid=?', array($userid));
echo $enrolids['enrolid'];
?>
Will appreciate the help....