Hallo,
habe eine tabelle fach. in der spalte 'studiengang' kommen 12 verschiedene einträge vor.
ich möchte mir diese 12 verschiedenen einmal anzeigen lassen.
folgendes script liefert mir aber 12 mal diese 12 obwohl die ergebnistabelle nur 12 rows enthält!
$result = mysql_query("SELECT distinct studiengang FROM fach");
while ($row = mysql_fetch_array($result))
{
print $row['studiengang'];
}
ergebnis:
ElektrotechnikInformatikMedientechnikBioinformatik Maschinenbau im PraxisverbundProduktentwicklung und DesignProduktions- und VerfahrenstechnikBiotechnologie/ChemietechnikChemietechnikUmwelttechnik/ChemietechnikPhotonikIBS
ElektrotechnikInformatikMedientechnikBioinformatik Maschinenbau im PraxisverbundProduktentwicklung und DesignProduktions- und VerfahrenstechnikBiotechnologie/ChemietechnikChemietechnikUmwelttechnik/ChemietechnikPhotonikIBS
... (12mal)
was mache ich falsch? Bitte um Hilfe!
habe eine tabelle fach. in der spalte 'studiengang' kommen 12 verschiedene einträge vor.
ich möchte mir diese 12 verschiedenen einmal anzeigen lassen.
folgendes script liefert mir aber 12 mal diese 12 obwohl die ergebnistabelle nur 12 rows enthält!
$result = mysql_query("SELECT distinct studiengang FROM fach");
while ($row = mysql_fetch_array($result))
{
print $row['studiengang'];
}
ergebnis:
ElektrotechnikInformatikMedientechnikBioinformatik Maschinenbau im PraxisverbundProduktentwicklung und DesignProduktions- und VerfahrenstechnikBiotechnologie/ChemietechnikChemietechnikUmwelttechnik/ChemietechnikPhotonikIBS
ElektrotechnikInformatikMedientechnikBioinformatik Maschinenbau im PraxisverbundProduktentwicklung und DesignProduktions- und VerfahrenstechnikBiotechnologie/ChemietechnikChemietechnikUmwelttechnik/ChemietechnikPhotonikIBS
... (12mal)
was mache ich falsch? Bitte um Hilfe!
Kommentar