zaloha databáze

nevi nekdo kde sehnat skript, ktery vypise obsah db do sql prikazu, neco jako v PhpMyAdminovi.
nebo jeste lepsi, aby to rozepsalo na .., hm, no viz příklad:
<?php
MySql_Query("zaznam1");
MySql_Query("zaznam2");
MySql_Query("zaznam3");
MySql_Query("zaznam4");
...
.
?>
<?php
require_once ('../_priprava.php');

$query = "show tables";
$query_result = mysql_query ($query, $db_connection);
while ($row = mysql_fetch_array ($query_result)) {

$filename = "./backup/" . date("Ymd") . "_$row[0].txt";
$fp = fopen ($filename, 'w');

$query1 = "select * from $row[0]";
$query_result1 = mysql_query ($query1, $spojeni);

while ($row1 = mysql_fetch_row ($query_result1)) {

$RADEK = "INSERT INTO $row[0] VALUES (";
foreach ($row1 as $key => $value) {
$RADEK .= "'$value', ";
}
$RADEK .= ");\n";

$RADEK = ereg_replace( ", );", ");", $RADEK );

fwrite ($fp, "$RADEK");
}

fclose ($fp);

echo "Table $row[0] Backed Up <br></br>\n";
}
?>





../_priprava.php obsahuje spojeni, vyber db a:
$sql_connect="MySQL_Connect";
$sql_selectdb="MySQL_Select_DB";
$sql_exec="MySQL_Query";
$sql_numrows="MySQL_Num_Rows";
$sql_fetch_array="MySQL_Fetch_Array";
$sql_result="MySQL_Result";
$sql_close="MySQL_Close";