Hi Crono,
vielen Dank für Dein Interesse an meinem Problem. Zunächst nocheinmal die Problembeschreibung.
Ich habe ein Suchformular mit einem SELECT-Feld (Dropdownliste) in dem ich mehrere Werte auswählen kann (multiple).
Diese voreingestellten Werte (option values) stammen aus einer Spalte meiner Datenbanktabelle verbunden mit Recordset (rs).
Nach dem Auswählen der gewünschten Werte in dieser Spalte und Abschicken (Submitbutton) sollen die vollständigen Datensätze (10-spaltig), in einer Ausgabedatei (aus.php) in eine dynamische Tabelle geschrieben und gelistet werden.
Und hier wird trotz Mehrfachauswahl im Formular immer nur ein Datensatz gelistet.
Der Code für das Suchformular:
###Suchformular:###
<?php require_once('../Connections/connbl.php'); ?>
<?php
mysql_select_db($database_connbl, $connbl);
$query_rs = "SELECT * FROM blneu ORDER BY blneu.Flurkartennummer ASC";
$rs = mysql_query($query_rs, $connbl) or die(mysql_error());
$row_rs = mysql_fetch_assoc($rs);
$totalRows_rs = mysql_num_rows($rs);
?>
<html>
<head>
<title>Unbenanntes Dokument</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<form action="aus.php" method="post" name="form1" target="_self">
<select name="auswahl" size="10" multiple="MULTIPLE">
<?php
do {
?>
<option value="<?php echo $row_rs['Flurkartennummer']?>"><?php echo $row_rs['Flurkartennummer']?></option>
<?php
} while ($row_rs = mysql_fetch_assoc($rs));
$rows = mysql_num_rows($rs);
if($rows > 0) {
mysql_data_seek($rs, 0);
$row_rs = mysql_fetch_assoc($rs);
}
?>
</select>
<input type="submit" name="Submit" value="Abschicken">
</form>
</body>
</html>
<?php
mysql_free_result($rs);
?>
###Ausgabedatei:###
<?php require_once('../Connections/connbl.php'); ?>
<?php
$colname_rs = "1";
if (isset($HTTP_POST_VARS['auswahl'])) {
$colname_rs = (get_magic_quotes_gpc()) ? $HTTP_POST_VARS['auswahl'] : addslashes($HTTP_POST_VARS['auswahl']);
}
mysql_select_db($database_connbl, $connbl);
$query_rs = sprintf("SELECT * FROM blneu WHERE Flurkartennummer = '%s' ORDER BY Flurkartennummer ASC", $colname_rs);
$rs = mysql_query($query_rs, $connbl) or die(mysql_error());
$row_rs = mysql_fetch_assoc($rs);
$totalRows_rs = mysql_num_rows($rs);
?>
<html>
<head>
<title>Unbenanntes Dokument</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<table border="2" cellpadding="2" cellspacing="2">
<tr>
<td>ID</td>
<td>Flurkartennummer</td>
<td>Y_LO</td>
<td>X_LO</td>
<td>Y_RO</td>
<td>X_RO</td>
<td>Y_LU</td>
<td>X_LU</td>
<td>Y_RU</td>
<td>X_RU</td>
</tr>
<?php do { ?>
<tr>
<td><?php echo $row_rs['ID']; ?></td>
<td><?php echo $row_rs['Flurkartennummer']; ?> </td>
<td><?php echo $row_rs['Y_LO']; ?></td>
<td><?php echo $row_rs['X_LO']; ?></td>
<td><?php echo $row_rs['Y_RO']; ?></td>
<td><?php echo $row_rs['X_RO']; ?></td>
<td><?php echo $row_rs['Y_LU']; ?></td>
<td><?php echo $row_rs['X_LU']; ?></td>
<td><?php echo $row_rs['Y_RU']; ?></td>
<td><?php echo $row_rs['X_RU']; ?></td>
</tr>
<?php } while ($row_rs = mysql_fetch_assoc($rs)); ?>
</table>
</body>
</html>
<?php
mysql_free_result($rs);
?>