Tabellenausgabe über SELECT-Feld

hman

Grünschnabel
Hallo,
ist es möglich, mittels eines multiplen SELECT-Feldes die ausgewählten Datensätze einer mySQL-DB in eine dynamischen Tabelle einer Ausgabedatei zu schreiben und anzeigen zu lassen?
Das Problem bei mir ist: Ich bekomme immer nur einen Datensatz in die Ausgabetabelle.
Wenn ich also z.B. 10 Datensätze im SELECT-Feld des Suchformulars markiere und abschicke, erhalte ich immer nur einen Datensatz angezeigt.
Hier der Code:
Suchformular:
PHP:
<?php require_once('../Connections/connbl.php'); ?>
<?php
mysql_select_db($database_connbl, $connbl);
$query_rs = "SELECT Flurkartennummer FROM blneu";
$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
error_reporting(E_ALL);
$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 = "SELECT * FROM blneu WHERE Flurkartennummer in ('$colname_rs') ORDER BY 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>
<table border="2" cellpadding="2" cellspacing="2" id="tab">
  <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);
?>

Bin schon am Verzweifeln.
MfG
hman
 
Zuletzt bearbeitet von einem Moderator:
Zurück