Tengo este código, ¿se podría convertir en ZIP a la hora de guardarlo? No entiendo mucho sobre esto, si me pueden ayudar se los agradezco.
Código PHP:
Ver original<?php
include('conect.php');
function datadump ($table) {
$result .= "# Tabla ".$table." \n";
$result .= "# Fecha: " . date("d-M-Y") ."\n\n"; $result .= "INSERT INTO ".$table." VALUES(";
for($j=0; $j<$num_fields; $j++) {
if (isset($row[$j])) $result .= "\"$row[$j]\"" ; else $result .= "\"\""; if ($j<($num_fields-1)) $result .= ",";
}
$result .= ");\n";
}
return $result . "\n\n\n";
}
for($i=0;$i<$tot_tablas;$i++){
$content.=datadump($nombre_tabla);
}
$file_name = "Backup (".date('Y-m-d').").sql"; header( "Content-Type: application/octet-stream"); header( "Content-Disposition: attachment; filename=".$file_name.""); echo $content;
?>