function PMA_getTableContent($db, $table, $limit_from = 0, $limit_to = 0, $handler, $crlf = "\n", $error_url = null) { 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 = ''; } PMA_getTableContentFast($db, $table, $add_query, $handler, $crlf, $error_url); }
/** * Dispatches between the versions of 'getTableContent' 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) * @param string the url to go back in case of error * * @access public * * @see PMA_getTableContentFast(), PMA_getTableContentOld() * * @author staybyte */ function PMA_getTableContent($db, $table, $limit_from = 0, $limit_to = 0, $handler, $error_url) { // 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 (PMA_PHP_INT_VERSION >= 40005) { PMA_getTableContentFast($db, $table, $add_query, $handler, $error_url); } else { PMA_getTableContentOld($db, $table, $add_query, $handler, $error_url); } }
$i++; } else { $formatted_table_name = isset($GLOBALS["_POST"]["use_backquotes"]) ? PMA_backquote($table) : "'" . $table . "'"; // If only datas, no need to displays table name if ($GLOBALS["_POST"]["what"] != "dataonly") { $dump_buffer .= "# --------------------------------------------------------" . $crlf . $crlf . "#" . $crlf . "# " . $strTableStructure . " " . $formatted_table_name . $crlf . "#" . $crlf . $crlf . PMA_getTableDef($db, $table, $crlf) . ";" . $crlf; } // At least data if ($GLOBALS["_POST"]["what"] == "data" || $GLOBALS["_POST"]["what"] == "dataonly") { $tcmt = $crlf . "#" . $crlf . "# " . $strDumpingData . " " . $formatted_table_name . $crlf . "#" . $crlf . $crlf; $dump_buffer .= $tcmt; $tmp_buffer = ""; /* swapfile */ swapfile_putdata($dump_buffer); /* swapfile */ PMA_getTableContentFast($db, $table, $add_query, "PMA_myHandler", $exptype); $dump_buffer .= $tmp_buffer; } // end if $i++; } // end if-else } // end while // staybyte: don't remove, it makes easier to select & copy from // browser $dump_buffer .= $crlf; } else { // Handles the EOL character if ($GLOBALS["_POST"]["what"] == "excel") { $add_character = "\r\n";