Hallo!
Ich habe 3 Tabellen
# TProdukte
[ProduktID - ProduktBeschreibung - .....]
# TMethoden
[MethodenID - MethodenName- ...]
#TProdukteMethoden (Verbindungstabelle)
[ProduktID - MethodenID]
Ich möchte es so darstellen (o.ä.)
Der Methode XY sind die Produkte 3,5,6,14 zugeordnet
Der Methode XY sind die Produkte 3,5,6,7 zugeordnet
usw.
Meine Abfrage
	
Leider wird alles "Kreuz-Und-Quer" angezeigt!? Warum?
Wo ist der Bug?
DANKE!!
					Ich habe 3 Tabellen
# TProdukte
[ProduktID - ProduktBeschreibung - .....]
# TMethoden
[MethodenID - MethodenName- ...]
#TProdukteMethoden (Verbindungstabelle)
[ProduktID - MethodenID]
Ich möchte es so darstellen (o.ä.)
Der Methode XY sind die Produkte 3,5,6,14 zugeordnet
Der Methode XY sind die Produkte 3,5,6,7 zugeordnet
usw.
Meine Abfrage
PHP-Code:
	
	
$sql = "SELECT * FROM TProdukte pro
inner join
TProdukteMethoden ref
on ref.ProduktID=pro.ProduktID
inner join
TMethoden pru
on pru.MethodenID=ref.MethodenID order by pro.ProduktID";
$result = mysql_query($sql) OR die(mysql_error());            
while($row = mysql_fetch_assoc($result)) 
{
$ProduktID=$row['ProduktID'];
$MethodenID=$row['MethodenID'];
$MethodenName=$row['MethodenName'];
$ProduktName=$row['ProduktName'];
#TEST-AUSGABE!!!!
echo $ProduktID;
echo "<br>-";
echo $MethodenID;
echo "<br>- $MethodenName<br>[$ProduktName]<br><br><br>";
} 
Wo ist der Bug?
DANKE!!
          
							
						
 
 Moderator
 
 
Kommentar