Exemplo n.º 1
0
 /**
  * Dispatches between the versions of 'get_table_content' to use depending
  * on the php version
  *
  * Last revision 13 July 2001: Patch for limiting dump size from
  * vinay@sanisoft.com & girish@sanisoft.com
  *
  * @param   string   the current database name
  * @param   string   the current table name
  * @param   integer  the offset on this table
  * @param   integer  the last row to get
  * @param   string   the name of the handler (function) to use at the end
  *                   of every row. This handler must accept one parameter
  *                   ($sql_insert)
  *
  * @see     get_table_content_fast(), get_table_content_old()
  * @author  staybyte
  */
 function get_table_content($db, $table, $limit_from = 0, $limit_to = 0, $handler)
 {
     // Defines the offsets to use
     if ($limit_from > 0) {
         $limit_from--;
     } else {
         $limit_from = 0;
     }
     if ($limit_to > 0 && $limit_from >= 0) {
         $add_query = " LIMIT {$limit_from}, {$limit_to}";
     } else {
         $add_query = '';
     }
     // Call the working function depending on the php version
     if (PHP_INT_VERSION >= 40005) {
         get_table_content_fast($db, $table, $add_query, $handler);
     } else {
         get_table_content_old($db, $table, $add_query, $handler);
     }
 }
Exemplo n.º 2
0
function get_table_content($db, $table, $limit_from = 0, $limit_to = 0, $handler)
{
    if ($limit_from > 0) {
        $limit_from--;
    } else {
        $limit_from = 0;
    }
    if ($limit_to > 0 && $limit_from >= 0) {
        $add_query = " LIMIT {$limit_from}, {$limit_to}";
    } else {
        $add_query = '';
    }
    get_table_content_fast($db, $table, $add_query, $handler);
}