Hi Sebastain
$sql = 'Your Sql Query';
You will fetch the single record from database below the code you will use,
$result = $DB->get_record_sql($sql);
or
You will fetch the multiple records from database below the code you will use,
$results = $DB->get_records_sql($sql);
For Example,
$sql = 'SELECT * FROM mdl_user';
$result = $DB->get_record_sql($sql);
Thanks
Kathir