- Added a db_query_range function. Patch by Natrak, slightly modified.

4.1.x
Dries Buytaert 2002-11-09 20:02:41 +00:00
parent c2f5ce820f
commit c93ab2a21f
2 changed files with 49 additions and 1 deletions

View File

@ -117,4 +117,36 @@ function db_affected_rows() {
return mysql_affected_rows();
}
/**
* Generates a limited query
*
* @param string $query query
* @param integer $from the row to start to fetching
* @param integer $count the numbers of rows to fetch
*
* @return mixed a DB_Result object or a DB_Error
*
* @access public
*/
function db_query_range($query, $from, $count) {
$query .= " LIMIT $from, $count";
// TODO: debug version
return db_query($query);
}
/**
* Generates a limited query
*
* @param string $query query
* @param integer $from the row to start to fetching
* @param integer $count the numbers of rows to fetch
*
* @access public
*/
function db_query_range($query, $from, $count) {
$query .= " LIMIT $from, $count";
// TODO: debug version
return db_query($query);
}
?>

View File

@ -112,4 +112,20 @@ function db_affected_rows() {
return $db_handle->affectedRows();
}
?>
/**
* Generates a limited query
*
* @param string $query query
* @param integer $from the row to start to fetching
* @param integer $count the numbers of rows to fetch
*
* @return mixed a DB_Result object or a DB_Error
*
* @access public
*/
function db_query_range($query, $from, $count) {
return DB::limitQuery($query, $from, $count);
}
?>