<?php
error_reporting(E_ALL);
include 'config.inc.php';
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html>
	<head>
		<title><?php echo $grade; ?></title>
		<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
	</head>
	<body>
<?php
@mysql_connect(MYSQL_HOST, MYSQL_USER, MYSQL_PASS) OR die(mysql_error());

mysql_select_db(MYSQL_DATABASE) OR die(mysql_error());
										   
$sql = "SELECT
         `Mail`
        FROM
          ".$grade."
        WHERE
          hidden = 0";
    
$result = mysql_query($sql) OR die(mysql_error());
        
?>
<table>
<?php		    
				
echo "\t<tr>\n";


while($row = mysql_fetch_assoc($result))
{
    echo $row['Mail'];
    echo ",";
}
echo "\n";
?>
	</body>
</html>