<html>
<body>
<form name="auswahl" method="post" action="<?php echo ($PHP_SELF);?>">
<p>
<?php
$db_server="localhost";
$db_name="infosystem";
$db_user="root";
$db_pass="";
$db=@mysql_connect($db_server, $db_user, $db_pass) OR die("Connect-Fehler");
mysql_select_db($db_name,$db);
$abfrage="SELECT * from `lehrfach`";
$ergebnis=mysql_query($abfrage);
while($datensatz=mysql_fetch_array($ergebnis))
{
$feld[]=$datensatz['fach'];
};
foreach($feld as $element)
{ echo "$element <br>";
};
?>
</body>
</html>