Skip to content

Commit

Permalink
Now get_records_sql() supports limitfrom and limitnum.
Browse files Browse the repository at this point in the history
Required to kill all those hardcoded LIMIT x,y clauses.
  • Loading branch information
stronk7 committed Sep 5, 2006
1 parent e4697bf commit 3c242a6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/dmllib.php
Original file line number Diff line number Diff line change
Expand Up @@ -701,10 +701,12 @@ function get_records_list($table, $field='', $values='', $sort='', $fields='*',
* Return value as for @see function get_records.
*
* @param string $sql the SQL select query to execute.
* @param int $limitfrom return a subset of records, starting at this point (optional, required if $limitnum is set).
* @param int $limitnum return a subset comprising this many records (optional, required if $limitfrom is set).
* @return mixed an array of objects, or false if no records were found or an error occured.
*/
function get_records_sql($sql) {
$rs = get_recordset_sql($sql);
function get_records_sql($sql, $limitfrom='', $limitnum='') {
$rs = get_recordset_sql($sql, $limitfrom='', $limitnum='');
return recordset_to_array($rs);
}

Expand Down

0 comments on commit 3c242a6

Please sign in to comment.