perlunity.de - PERL | JAVASCRIPT | PHP | MySQL | APACHE



#!/COMMUNITY

Members: 5374
davon online: 1
weitere User: 19
Click for quality!




12.02.2012 / 03:46

Community-Member werden   |   Paßwort vergessen   |   OnlineMonitor (1) Wer ist online ... OnlineMonitor starten !
     

 

Home


PERLscripts


PHPscripts


JAVAscripts


Hilfreiches


Links2www


Newscenter


Community


Interna




Community  »  PHP: Allgemeines Forum zur Themenübersicht Themensuche Themenansicht in Thread-Modus


BeitragMit 2 Auswahlfelder eine Datenbank abrufen
Seitenanfang
Hallo Leute!
Ich komm einfach nicht dahinter wie man bei einem Formular mit zwei <select> Felder eine Datenbank abruft.
Ich bin in PHP noch ein Frischling bitte helft mir.
Bis jetzt habe ich:
formular->

<form name="abfrage" action="firmen.php" method="POST">
<select name="land">
<option>Treffen Sie eine Auswahl</option>
<option value="Land1">Land1 </option>
<option value="Land2">Land2 </option>
</select>

<select name="branche">
<option>Treffen Sie eine Auswahl</option>
<option value="Branche1">Branche1 </option>
<option value="Branche2">Branche2 </option>
</select>
</form>

<?
if (isset($_POST['land'])) {
$land ="land = '{$_POST['land']}'";
}
if (isset($_POST['branche'])) {
$land ="branche = '{$_POST['branche']}'";
}
$sql = "SELECT * FROM firmen WHERE ($land) AND ($branche) order by name";

$result = mysql_query($sql);
if ($result) {
while ($row = mysql_fetch_array ($result)){

$land=htmlentities($row['land']);
$branche=htmlentities($row['branche']);

echo " $land $branche";
}
}
?>

Danke in voraus für die Hilfe
lg kati

Datum: 01.10.2005-10:31

-






-
-