Hallo, vielen dank für die schnelle antwort,
doch leider funktioniert das irgendwie immer noch nicht.
egal was ich in der auswahlliste auswähle, kommt eine leere tabelle,
obwohl in der datenbank daten vorhanden sind.
wahrscheinlich wird da der wert von der auswahlliste nicht übernommen oder keine ahnung.
ich schick mal noch mal den geänderten code.
auswahlsuche.php
PHP-Code:
<?php
$link = mysql_connect("localhost", "root", "test");
mysql_select_db("einflussgroessen", $link);
echo"<FORM ACTION=\"suchausgabe.php\" METHOD=POST>";//Formularziel
$tabellenname="applikation";
echo"</P><P><b>Applikation:<b> <select NAME=\"applikation\">";
$abfrage = "SELECT applikation , applikation_id FROM applikation ORDER BY applikation";
$ergebnis = mysql_query($abfrage);
while ($m_fetch = mysql_fetch_object($ergebnis)) {
echo "<option value='{$m_fetch->applikation_id}'>{$m_fetch->applikation}</option></P><br>";
}
echo"</select></CENTER></P>";
echo"</P><P><INPUT TYPE=submit NAME=Absenden VALUE=\"Suchen\"></CENTER>";
echo"</FORM> </FONT></P></BLOCKQUOTE>";
?>
und
suchausgabe.php
PHP-Code:
<html><head>
<title>Suchergebnis</title>
</head>
<body>
<h1>Suchergebnisse</h1>
<?php
$link = mysql_connect(...);
mysql_select_db("einflussgroessen", $link);
$applikation = $_POST['applikation'];
$sql="select applikation.applikation, applikation.applikation_id
from applikation inner join einflussdetail
on applikation.applikation_id = einflussdetail.applikation_id
where applikation = '$applikation'";
$result = mysql_query($sql);
print "<table border=\"1\" cellspacing=\"2\" ".
"cellpadding=\"2\">\n";
print "<tr><th>id</th><th>applikation</th></tr>\n";
while ($dataset = mysql_fetch_array($result)){
print "<tr>";
print "<td>".$dataset['applikation_id']."</td>";
print "<td>".$dataset['applikation']."</td>";
print "</tr>\n";
}
print "</table>\n";
?>
</body></html>
also wie gesagt es kommt nur eine tabelle mit den überschriften applikation-id und applikation.
vielleicht fällt da noch was?
vielen dank für die hilfe!
lg tatjana