Moved sql_limit() to the db classes and renamed it to limit()

This commit is contained in:
jengo 2001-01-25 06:09:08 +00:00
parent 6c15e4a6d3
commit 9505b365d6
4 changed files with 28 additions and 7 deletions

View File

@ -447,13 +447,8 @@
}
}
function navbar($called_directly = True)
{
// This is only temp, until will change everything to use the new method
if ($called_directly) {
echo '<center><b>Warning: You can no longer call navbar() directly, use echo parse_navbar() from now on.</b></center>';
}
function navbar()
{
global $phpgw_info, $phpgw;
$phpgw_info["navbar"]["home"]["title"] = "Home";

View File

@ -97,6 +97,16 @@ class db {
return mysql_close($this->Link_ID);
}
function limit($start,$offset)
{
if ($start == 0) {
$s = "limit $start";
} else {
$s = "limit $start,$offset";
}
return $s;
}
/* public: discard the query result */
function free() {
@mysql_free_result($this->Query_ID);

View File

@ -61,6 +61,16 @@ class db {
}
}
function limit($start,$offset)
{
if ($start == 0) {
$s = "limit $offset";
} else {
$s = "limit $offset,$start";
}
return $s;
}
// This only affects systems not using persistant connections
function disconnect()
{

View File

@ -324,8 +324,14 @@ class nextmatchs
// Postgre and MySQL switch the vars in limit. This will make it easier
// if there are any other databases that pull this.
// NOTE!! This is is NO longer used. Use db->limit() instead.
// This is here for people to get there code up to date.
function sql_limit($start)
{
echo "<center><b>WARNING:</b> Do not use sql_limit() anymore. Use db->limit() from now on.</center>";
global $phpgw_info;
$max = $phpgw_info["user"]["preferences"]["common"]["maxmatchs"];