<?php
$hostspec = 'localhost';
$username = 'root';
$password = '';
$database = 'mydb';
$nodata = false; #!DO NOT DUMP TABLES DATA
$nostruct = false; #!DO NOT DUMP TABLES STRUCTURE
$gzip = false; #!DO GZIP OUTPUT
$link = mysql_connect("$hostspec", "$username", "$password",false,MYSQL_CLIENT_COMPRESS);
require_once(getcwd()."/class_mysqldump.php");
$dump = new MySQLDump();
$dbdata = $dump->dumpDatabase($database,$nodata,$nostruct);
mysql_close($link);
if($gzip == false){
$dump->sendAttachFile($dbdata,'text/html','sql_dump.sql');}else{
$dump->sendAttachFileGzip($dbdata,'sql_dump.sql.gz');}
?>
|