\n";
} 
else 
{
    header("Content-disposition: filename=$id.sql");
    header("Content-type: application/octetstream");
    header("Pragma: no-cache");
    header("Expires: 0");
}

function my_handler($sql_insert)
{
    global $crlf, $asfile;
    
    if(empty($asfile)) 
    {
        echo htmlspecialchars("$sql_insert;$crlf");
    }
    else
    {
        echo "$sql_insert;$crlf";
    }
}

$tables = mysql_list_tables(PPHL_DB_NAME);

$num_tables = @mysql_numrows($tables);

$i = 0;
print "# PPhlogger ".PPHLOGGER_VERSION." MySQL-Dump".CRLF_C;
print "# $pphlogger_location".CRLF_C;
print "#".CRLF_C;
print "# Host: ".PPHL_DB_HOST." Database: ".PPHL_DB_NAME.CRLF_C;

while($i < $num_tables)
{ 
	$table = mysql_tablename($tables, $i);

	if (strstr($table,$id)) {
		print $crlf;
		print "# --------------------------------------------------------".CRLF_C;
		print "#".CRLF_C;
		print "# Table structure for table '$table'".CRLF_C;
		print "#".CRLF_C.CRLF_C;
	
		echo get_table_def($table, $crlf).";".CRLF_C.CRLF_C;
	        
		if($what == "data") {
			print "#".CRLF_C;
			print "# Dumping data for table '$table'".CRLF_C;
			print "#".CRLF_C.CRLF_C;
	        
			get_table_content($table, "my_handler", "");
		}
	}
	
	$i++;
}


if(empty($asfile))
{
    print "
\n"; echo $myfooter; } ?>