Skip to content
Snippets Groups Projects
Commit fc6dfc94 authored by Frode Petterson's avatar Frode Petterson
Browse files

Fixes #93, use Moodle's SQL limit func

parent f4467e8a
Branches
Tags
No related merge requests found
...@@ -161,9 +161,9 @@ class results { ...@@ -161,9 +161,9 @@ class results {
{$join} {$join}
{$where} {$where}
{$order_by} {$order_by}
LIMIT {$this->limit} ", $args,
OFFSET {$this->offset} $this->offset,
", $args); $this->limit);
} }
/** /**
...@@ -312,8 +312,8 @@ class results { ...@@ -312,8 +312,8 @@ class results {
* @param array $args Used for placeholders * @param array $args Used for placeholders
* @return array * @return array
*/ */
protected function get_sql_results($query, $args) { protected function get_sql_results($query, $args, $limitfrom = 0, $limitnum = 0) {
global $DB; global $DB;
return $DB->get_records_sql($query, $args); return $DB->get_records_sql($query, $args, $limitfrom, $limitnum);
} }
} }
...@@ -121,7 +121,7 @@ class mod_hvp_mod_form extends moodleform_mod { ...@@ -121,7 +121,7 @@ class mod_hvp_mod_form extends moodleform_mod {
} }
// Determine default action // Determine default action
if ($content === null && $DB->get_field_sql("SELECT id FROM {hvp_libraries} WHERE runnable = 1 LIMIT 1") === false) { if ($content === null && $DB->get_field_sql("SELECT id FROM {hvp_libraries} WHERE runnable = 1", null, IGNORE_MULTIPLE) === false) {
$defaultvalues['h5paction'] = 'upload'; $defaultvalues['h5paction'] = 'upload';
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment