Debugging sql_paging_limit() as deprecated and

enforcing get_field_sql() to return 1 record max

Merged from MOODLE_17_STABLE
This commit is contained in:
stronk7
2006-10-22 23:21:59 +00:00
parent 55d3af6f3a
commit c1bf1b0073
+3 -1
View File
@@ -894,7 +894,7 @@ function get_field_select($table, $return, $select) {
function get_field_sql($sql) {
global $CFG;
$rs = get_recordset_sql($sql);
$rs = get_recordset_sql($sql, 0, 1);
if ($rs && $rs->RecordCount() == 1) {
/// DIRTY HACK to retrieve all the ' ' (1 space) fields converted back
@@ -1369,6 +1369,8 @@ function update_record($table, $dataobject) {
function sql_paging_limit($page, $recordsperpage) {
global $CFG;
debugging('Function sql_paging_limit() is deprecated. Replace it with the correct use of limitfrom, limitnum parameters', DEBUG_DEVELOPER);
switch ($CFG->dbtype) {
case 'postgres7':
return 'LIMIT '. $recordsperpage .' OFFSET '. $page;