Patch by Ax:
- db_query_range() in database.mysql.inc wasn't updated to match db_query(). - Fixed phpdoc.4.2.x
parent
583104ce28
commit
b2583b624c
|
@ -118,18 +118,26 @@ function db_affected_rows() {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generates a limited query
|
* Runs a LIMIT query in the database.
|
||||||
*
|
*
|
||||||
* @param string $query query
|
* @param mixed $query SQL query, followed by a variable number of arguments which are substituted into query by sprintf, followed by 'from' and 'count' parameters. 'from' is the row to start fetching, 'count' the numbers of rows to fetch.
|
||||||
* @param integer $from the row to start to fetching
|
* @return resource a MySQL result or FALSE if the query was not executed correctly.
|
||||||
* @param integer $count the numbers of rows to fetch
|
* @access public
|
||||||
*
|
|
||||||
* @access public
|
|
||||||
*/
|
*/
|
||||||
function db_query_range($query, $from, $count) {
|
function db_query_range($query) {
|
||||||
|
$args = func_get_args();
|
||||||
|
$count = array_pop($args);
|
||||||
|
$from = array_pop($args);
|
||||||
|
if (count(func_get_args()) > 3) {
|
||||||
|
$args = array_map("check_query", $args);
|
||||||
|
$args[0] = $query;
|
||||||
|
$query = call_user_func_array("sprintf", $args);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$query = func_get_arg(0);
|
||||||
|
}
|
||||||
$query .= " LIMIT $from, $count";
|
$query .= " LIMIT $from, $count";
|
||||||
// TODO: debug version
|
return _db_query($query);
|
||||||
return db_query($query);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -18,9 +18,9 @@ function db_connect($url) {
|
||||||
/**
|
/**
|
||||||
* Runs a query in the database.
|
* Runs a query in the database.
|
||||||
*
|
*
|
||||||
* @param $query sql query
|
* @param $query SQL query
|
||||||
* @param $type module type of this item
|
* @param $type module type of this item
|
||||||
* @return sql result resource
|
* @return sql result resource
|
||||||
*/
|
*/
|
||||||
function db_query($query) {
|
function db_query($query) {
|
||||||
|
|
||||||
|
@ -130,9 +130,8 @@ function db_affected_rows() {
|
||||||
/**
|
/**
|
||||||
* Runs a LIMIT query in the database.
|
* Runs a LIMIT query in the database.
|
||||||
*
|
*
|
||||||
* @param $query sql query followed by 'from' and 'count' parameters, followed by a variable number of arguments which are substituted into query by sprintf. 'from' is the row to start to fetching. 'count' the numbers of rows to fetch.
|
* @param mixed $query SQL query followed by a variable number of arguments which are substituted into query by sprintf, followed by 'from' and 'count' parameters. 'from' is the row to start fetching, 'count' the numbers of rows to fetch.
|
||||||
* @return mixed a DB_Result object or a DB_Error
|
* @return mixed a DB_Result object or a DB_Error
|
||||||
*
|
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function db_query_range($query) {
|
function db_query_range($query) {
|
||||||
|
@ -170,4 +169,4 @@ function db_query_range($query) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
Loading…
Reference in New Issue