S
SB_99
Hi Boardies,
hab da ein problem. und zwar möchte ich das ein dropdown seine werte aus einer datenbank erhällt. das ist jetzt was ich auf die beine gestellt habe
allerdings gibt mir das nur ein eintrag zweimal aus und nicht alle einträge in der DB
Weis jemand rat?
Danke schonmal im voraus
hab da ein problem. und zwar möchte ich das ein dropdown seine werte aus einer datenbank erhällt. das ist jetzt was ich auf die beine gestellt habe
PHP:
$sqlbefehl= "Select * FROM wohnung order by ort";
$serverid = mysql_connect ( $sqlhost, $sqluser, $sqlpass);
echo mysql_error($serverid);
if (!mysql_select_db( $database))
echo mysql_error($serverid);
if (!$ergebnis = mysql_query($sqlbefehl, $serverid))
echo mysql_error($serverid);
$spalte = mysql_fetch_array ($ergebnis);
mysql_select_db($database);
?>
<table width="100%">
<form method="post" action="eingabe_uebersicht.php">
<tr>
<td>
<select name="ort">
<option selected><?php echo $ort ?></option>
<? while ( $spalte = mysql_fetch_array ($ergebnis)) {
echo "<option>$spalte[ort]</option>";
}
?>
</select>
<input type="submit" value="Anzeigen"></td></tr></table></form>
</td>
</tr>
</table>
Weis jemand rat?
Danke schonmal im voraus