<?php

$hostspec = 'localhost';

$username = 'root';

$password = '';

$database = 'newsletter';



$nodata   = false;      #!DO NOT DUMP TABLES DATA

$nostruct = false;      #!DO NOT DUMP TABLES STRUCTURE

$gzip     = true;      #!DO GZIP OUTPUT



$link = mysql_connect("$hostspec", "$username", "$password",false,MYSQL_CLIENT_COMPRESS);

require_once("classes/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');}

?>