Código PHP:
/********************************************************************************/
/* FUNC PARA REALIZAR UN BACKUP DE MYSQL Y ENVIARLO AL NAVEGADOR: SERVER WIN */
/********************************************************************************/
function FUNC_backupW32($file_backup,$resultado){//FUNC_backupW32($file_backup='backup.sql',$resultado);
header("Pragma: no-cache");
header("Expires: 0");
header("Content-Transfer-Encoding: binary");
header("Content-type: application/force-download");
header("Content-Disposition: attachment; filename=$filename");
$executa = "c:\mysql\bin\mysqldump.exe -u $sql_usuario --password=$sql_pass --opt $sql_db";
system($executa, $resultado);
if ($resultado) { echo "<H1>Error ejecutando comando: $executa</H1>\n"; }
}
//////////////////////////////////////////////////////////////////////////////////
/********************************************************************************/
/* FUNC PARA REALIZAR UN BACKUP DE MYSQL Y ENVIARLO AL NAVEGADOR: SERVER UNIX */
/********************************************************************************/
function FUNC_backupLinux($file_backup,$resultado){//FUNC_backupLinux($file_backup='backup.sql',$resultado);
header("Pragma: no-cache");
header("Expires: 0");
header("Content-Transfer-Encoding: binary");
header("Content-type: application/force-download");
header("Content-Disposition: attachment; filename=$filename");
$executa = "mysqldump -u $sql_usuario --password=$sql_pass --opt $sql_db";
system($executa, $resultado);
if ($resultado) { echo "<H1>Error ejecutando comando: $executa</H1>\n"; }
}
//////////////////////////////////////////////////////////////////////////////////