Hallo ich habe vollgendes Problemm.
Ich möchte, dass das Feld das ich ausgewählt habe in meiner PHP auftaucht.
Beispiel wähle ich "Standort A" soll er auf die SQL Tabelle "Standort A" zugreifen.
Ich möchte, dass das Feld das ich ausgewählt habe in meiner PHP auftaucht.
Beispiel wähle ich "Standort A" soll er auf die SQL Tabelle "Standort A" zugreifen.
PHP-Code:
<html>
<body>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
>>>>>>>
<div>
<select class="selectbox">
<option value='0'>Standort</option>
<option value='A' <? if($_POST['select1']=='A') echo 'selected="selecetd"'?>>Standort A</option>
<option value='B' <? if($_POST['select2']=='B') echo 'selected="selecetd"'?>>Standort B</option>
<option value='C' <? if($_POST['select3']=='C') echo 'selected="selecetd"'?>>Standort C</option>
</select>
</div>
>>>>>>>
>>>>>>>
<?php
mysql_connect ( " ", "USER", "USER" );
mysql_select_db ("Daten-Orte");
$res = mysql_query ("select * from [B][[ Hier soll die Eingabe aus dem Auswahlfensster stehen]][/B]");
$num = mysql_num_rows ($res) ;
echo "$num Datensätze gefunden<br />" ;
echo '<table border="0" width="800">
<tr>
<td>Name</td>
<td>E-Mail</td>
<td>Schwerpunkt</td>
</tr>';
while($dsatz = mysql_fetch_assoc($res)){
echo "<tr>";
echo "<td>". $dsatz["Bezeichnung"] . " " . $dsatz["Vorname"] . " " . $dsatz["Name"] . " " . "</td>";
echo "<td>". $dsatz['E-Mail'] . "</td>";
echo "<td>". $dsatz["Schwerpunkt 1"] . "<br />" . $dsatz["Schwerpunkt 2"] . "<br />" . $dsatz["Schwerpunkt 3"] . "<br />" . $dsatz["Schwerpunkt 4"] . "<br />" . $dsatz["Schwerpunkt 5"] . "</td>";
echo "</tr>";
}
mysql_close($dsatz);
?>

Kommentar