diff --git a/htdocs/core/db/DoliDB.class.php b/htdocs/core/db/DoliDB.class.php index e95d31acf6e..aa0792c5970 100644 --- a/htdocs/core/db/DoliDB.class.php +++ b/htdocs/core/db/DoliDB.class.php @@ -174,6 +174,22 @@ abstract class DoliDB implements Database } } + /** + * Define limits and offset of request + * + * @param int $limit Maximum number of lines returned (-1=conf->liste_limit, 0=no limit) + * @param int $offset Numero of line from where starting fetch + * @return string String with SQL syntax to add a limit and offset + */ + function plimit($limit=0,$offset=0) + { + global $conf; + if (empty($limit)) return ""; + if ($limit < 0) $limit=$conf->liste_limit; + if ($offset > 0) return " LIMIT $offset,$limit "; + else return " LIMIT $limit "; + } + /** * Return version of database server into an array * diff --git a/htdocs/core/db/mssql.class.php b/htdocs/core/db/mssql.class.php index 239582a6595..855b7a71026 100644 --- a/htdocs/core/db/mssql.class.php +++ b/htdocs/core/db/mssql.class.php @@ -466,24 +466,6 @@ class DoliDBMssql extends DoliDB if (is_resource($resultset)) mssql_free_result($resultset); } - - /** - * Define limits and offset of request - * - * @param int $limit Maximum number of lines returned (-1=conf->liste_limit, 0=no limit) - * @param int $offset Numero of line from where starting fetch - * @return string String with SQL syntax to add a limit and offset - */ - function plimit($limit=0,$offset=0) - { - global $conf; - if (empty($limit)) return ""; - if ($limit < 0) $limit=$conf->liste_limit; - if ($offset > 0) return " LIMIT $offset,$limit "; - else return " LIMIT $limit "; - } - - /** * Escape a string to insert data * diff --git a/htdocs/core/db/mysql.class.php b/htdocs/core/db/mysql.class.php index a0228a1b00c..efe942caed5 100644 --- a/htdocs/core/db/mysql.class.php +++ b/htdocs/core/db/mysql.class.php @@ -365,24 +365,6 @@ class DoliDBMysql extends DoliDB if (is_resource($resultset)) mysql_free_result($resultset); } - - /** - * Define limits and offset of request - * - * @param int $limit Maximum number of lines returned (-1=conf->liste_limit, 0=no limit) - * @param int $offset Numero of line from where starting fetch - * @return string String with SQL syntax to add a limit and offset - */ - function plimit($limit=0,$offset=0) - { - global $conf; - if (empty($limit)) return ""; - if ($limit < 0) $limit=$conf->liste_limit; - if ($offset > 0) return " LIMIT $offset,$limit "; - else return " LIMIT $limit "; - } - - /** * Escape a string to insert data * diff --git a/htdocs/core/db/mysqli.class.php b/htdocs/core/db/mysqli.class.php index 3c23a85e027..f2dd2e80359 100644 --- a/htdocs/core/db/mysqli.class.php +++ b/htdocs/core/db/mysqli.class.php @@ -376,24 +376,6 @@ class DoliDBMysqli extends DoliDB if (is_object($resultset)) mysqli_free_result($resultset); } - - /** - * Define limits and offset of request - * - * @param int $limit Maximum number of lines returned (-1=conf->liste_limit, 0=no limit) - * @param int $offset Numero of line from where starting fetch - * @return string String with SQL syntax to add a limit and offset - */ - function plimit($limit=0,$offset=0) - { - global $conf; - if (empty($limit)) return ""; - if ($limit < 0) $limit=$conf->liste_limit; - if ($offset > 0) return " LIMIT $offset,$limit "; - else return " LIMIT $limit "; - } - - /** * Escape a string to insert data * diff --git a/htdocs/core/db/sqlite.class.php b/htdocs/core/db/sqlite.class.php index d0285e57457..8c3e9fa9df3 100644 --- a/htdocs/core/db/sqlite.class.php +++ b/htdocs/core/db/sqlite.class.php @@ -510,24 +510,6 @@ class DoliDBSqlite extends DoliDB if (is_object($resultset)) $resultset->closeCursor(); } - - /** - * Define limits and offset of request - * - * @param int $limit Maximum number of lines returned (-1=conf->liste_limit, 0=no limit) - * @param int $offset Numero of line from where starting fetch - * @return string String with SQL syntax to add a limit and offset - */ - function plimit($limit=0,$offset=0) - { - global $conf; - if (empty($limit)) return ""; - if ($limit < 0) $limit=$conf->liste_limit; - if ($offset > 0) return " LIMIT $offset,$limit "; - else return " LIMIT $limit "; - } - - /** * Escape a string to insert data *