mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-14 09:58:16 +01:00
Changed the limit_query() function to make it easier for developers to use (NOT TESTED)
This commit is contained in:
parent
fc49aa8594
commit
11d1dbc646
@ -73,15 +73,24 @@ class db {
|
|||||||
return $this->Query_ID;
|
return $this->Query_ID;
|
||||||
}
|
}
|
||||||
|
|
||||||
function limit_query($Query_String, $offset, $num_rows, $line = '', $file = '')
|
function limit_query($Query_String, $_offset, $line = '', $file = '')
|
||||||
{
|
{
|
||||||
global $phpgw_info;
|
global $phpgw_info;
|
||||||
|
|
||||||
if ($this->Debug)
|
if ($this->Debug)
|
||||||
|
{
|
||||||
printf("Debug: limit_query = %s<br>offset=%d, num_rows=%d<br>\n", $Query_String, $offset, $num_rows);
|
printf("Debug: limit_query = %s<br>offset=%d, num_rows=%d<br>\n", $Query_String, $offset, $num_rows);
|
||||||
|
}
|
||||||
|
|
||||||
if (!IsSet($num_rows) || $num_rows < 1)
|
if (is_array($_offset))
|
||||||
|
{
|
||||||
|
list($offset,$num_rows) = $_offset;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
$num_rows = $phpgw_info['user']['preferences']['common']['maxmatchs'];
|
$num_rows = $phpgw_info['user']['preferences']['common']['maxmatchs'];
|
||||||
|
$offset = $_offset;
|
||||||
|
}
|
||||||
|
|
||||||
$this->query($Query_String, $line, $file);
|
$this->query($Query_String, $line, $file);
|
||||||
if ($this->Query_ID)
|
if ($this->Query_ID)
|
||||||
|
Loading…
Reference in New Issue
Block a user