Bitte hilf mir etwas genauer.
Verstehe nicht genau was statt "..." eingetragen werden muss. und was bei "Elementauswählen...." rein kommt.
PHP-Code:
<?php require_once('Connections/musikerheim.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}
if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1")) {
$updateSQL = sprintf("UPDATE eingabe SET TischNr=%s, Zeit=%s, einsanzahl=%s, zweianzahl=%s, dreianzahl=%s, vieranzahl=%s, fuenfanzahl=%s, sechsanzahl=%s, siebenanzahl=%s, achtanzahl=%s, neunanzahl=%s, zehnanzahl=%s, elfanzahl=%s, zwoelfanzahl=%s, dreizehnanzahl=%s, vierzehnanzahl=%s, fuenfzehnanzahl=%s, sechzehnanzahl=%s, bemerkung=%s WHERE ID=%s",
GetSQLValueString($_POST['TischNr'], "int"),
GetSQLValueString($_POST['Zeit'], "int"),
GetSQLValueString($_POST['einsanzahl'], "int"),
GetSQLValueString($_POST['zweianzahl'], "int"),
GetSQLValueString($_POST['dreianzahl'], "int"),
GetSQLValueString($_POST['vieranzahl'], "int"),
GetSQLValueString($_POST['fuenfanzahl'], "int"),
GetSQLValueString($_POST['sechsanzahl'], "int"),
GetSQLValueString($_POST['siebenanzahl'], "int"),
GetSQLValueString($_POST['achtanzahl'], "int"),
GetSQLValueString($_POST['neunanzahl'], "int"),
GetSQLValueString($_POST['zehnanzahl'], "int"),
GetSQLValueString($_POST['elfanzahl'], "int"),
GetSQLValueString($_POST['zwoelfanzahl'], "int"),
GetSQLValueString($_POST['dreizehnanzahl'], "int"),
GetSQLValueString($_POST['vierzehnanzahl'], "int"),
GetSQLValueString($_POST['fuenfzehnanzahl'], "int"),
GetSQLValueString($_POST['sechzehnanzahl'], "int"),
GetSQLValueString($_POST['bemerkung'], "int"),
GetSQLValueString($_POST['ID'], "int"));
mysql_select_db($database_musikerheim, $musikerheim);
$Result1 = mysql_query($updateSQL, $musikerheim) or die(mysql_error());
}
if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form2")) {
$updateSQL = sprintf("UPDATE eingabe SET TischNr=%s, Zeit=%s, einsanzahl=%s, zweianzahl=%s, dreianzahl=%s, vieranzahl=%s, fuenfanzahl=%s, sechsanzahl=%s, siebenanzahl=%s, achtanzahl=%s, neunanzahl=%s, zehnanzahl=%s, elfanzahl=%s, zwoelfanzahl=%s, dreizehnanzahl=%s, vierzehnanzahl=%s, fuenfzehnanzahl=%s, sechzehnanzahl=%s, bemerkung=%s WHERE ID=%s",
GetSQLValueString($_POST['TischNr'], "text"),
GetSQLValueString($_POST['Zeit'], "text"),
GetSQLValueString($_POST['einsanzahl'], "int"),
GetSQLValueString($_POST['zweianzahl'], "int"),
GetSQLValueString($_POST['dreianzahl'], "int"),
GetSQLValueString($_POST['vieranzahl'], "int"),
GetSQLValueString($_POST['fuenfanzahl'], "int"),
GetSQLValueString($_POST['sechsanzahl'], "int"),
GetSQLValueString($_POST['siebenanzahl'], "int"),
GetSQLValueString($_POST['achtanzahl'], "int"),
GetSQLValueString($_POST['neunanzahl'], "int"),
GetSQLValueString($_POST['zehnanzahl'], "int"),
GetSQLValueString($_POST['elfanzahl'], "int"),
GetSQLValueString($_POST['zwoelfanzahl'], "int"),
GetSQLValueString($_POST['dreizehnanzahl'], "int"),
GetSQLValueString($_POST['vierzehnanzahl'], "int"),
GetSQLValueString($_POST['fuenfzehnanzahl'], "int"),
GetSQLValueString($_POST['sechzehnanzahl'], "int"),
GetSQLValueString($_POST['bemerkung'], "text"),
GetSQLValueString($_POST['ID'], "int"));
mysql_select_db($database_musikerheim, $musikerheim);
$Result1 = mysql_query($updateSQL, $musikerheim) or die(mysql_error());
}
if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form2")) {
$updateSQL = sprintf("UPDATE eingabe SET TischNr=%s, Zeit=%s, einsanzahl=%s, zweianzahl=%s, dreianzahl=%s, vieranzahl=%s, fuenfanzahl=%s, sechsanzahl=%s, siebenanzahl=%s, achtanzahl=%s, neunanzahl=%s, zehnanzahl=%s, elfanzahl=%s, zwoelfanzahl=%s, dreizehnanzahl=%s, vierzehnanzahl=%s, fuenfzehnanzahl=%s, sechzehnanzahl=%s, bemerkung=%s WHERE ID=%s",
GetSQLValueString($_POST['TischNr'], "text"),
GetSQLValueString($_POST['Zeit'], "text"),
GetSQLValueString($_POST['einsanzahl'], "int"),
GetSQLValueString($_POST['zweianzahl'], "int"),
GetSQLValueString($_POST['dreianzahl'], "int"),
GetSQLValueString($_POST['vieranzahl'], "int"),
GetSQLValueString($_POST['fuenfanzahl'], "int"),
GetSQLValueString($_POST['sechsanzahl'], "int"),
GetSQLValueString($_POST['siebenanzahl'], "int"),
GetSQLValueString($_POST['achtanzahl'], "int"),
GetSQLValueString($_POST['neunanzahl'], "int"),
GetSQLValueString($_POST['zehnanzahl'], "int"),
GetSQLValueString($_POST['elfanzahl'], "int"),
GetSQLValueString($_POST['zwoelfanzahl'], "int"),
GetSQLValueString($_POST['dreizehnanzahl'], "int"),
GetSQLValueString($_POST['vierzehnanzahl'], "int"),
GetSQLValueString($_POST['fuenfzehnanzahl'], "int"),
GetSQLValueString($_POST['sechzehnanzahl'], "int"),
GetSQLValueString($_POST['bemerkung'], "text"),
GetSQLValueString($_POST['ID'], "int"));
mysql_select_db($database_musikerheim, $musikerheim);
$Result1 = mysql_query($updateSQL, $musikerheim) or die(mysql_error());
}
mysql_select_db($database_musikerheim, $musikerheim);
$query_Recordset2 = "SELECT * FROM speisenauswahl";
$Recordset2 = mysql_query($query_Recordset2, $musikerheim) or die(mysql_error());
$row_Recordset2 = mysql_fetch_assoc($Recordset2);
$totalRows_Recordset2 = mysql_num_rows($Recordset2);
mysql_select_db($database_musikerheim, $musikerheim);
$query_Recordset3 = "SELECT * FROM speisenraus";
$Recordset3 = mysql_query($query_Recordset3, $musikerheim) or die(mysql_error());
$row_Recordset3 = mysql_fetch_assoc($Recordset3);
$totalRows_Recordset3 = mysql_num_rows($Recordset3);
mysql_select_db($database_musikerheim, $musikerheim);
$query_Recordset1 = "SELECT * FROM eingabe";
$Recordset1 = mysql_query($query_Recordset1, $musikerheim) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Unbenanntes Dokument</title>
<style type="text/css">
<!--
.Stil3 {font-family: Arial, Helvetica, sans-serif}
.Stil4 {font-size: 12px}
.Stil5 {font-family: Arial, Helvetica, sans-serif; font-size: 12px; }
.Stil6 { font-size: 18px;
color: #000099;
}
-->
</style>
</head>
<body>
<?php do { ?>
<form action="<?php echo $editFormAction; ?>" method="post" name="form1" id="form1">
<table width="1251" height="178" border="1" align="center" bordercolor="#0000FF">
<tr valign="baseline">
<td width="151" height="32" align="right" nowrap="nowrap" bordercolor="#CCFF33" bgcolor="#CCCC33"><div align="center" class="Stil3 Stil4">
<div align="right"> Tisch Nr.:
<input type="text" name="TischNr" value="<?php echo htmlentities($row_Recordset1['TischNr'], ENT_COMPAT, 'utf-8'); ?>" size="5" />
</div>
</div></td>
<td width="133" bordercolor="#CCFF33"><div align="right"></div></td>
<td width="138" bordercolor="#CCFF33" bgcolor="#33FF33"><div align="right">Zeit:
<input type="text" name="Zeit" value="<?php echo htmlentities($row_Recordset1['Zeit'], ENT_COMPAT, 'utf-8'); ?>" size="5" />
</div></td>
<td width="136" bordercolor="#CCFF33"><div align="right"></div></td>
<td width="149" bordercolor="#CCFF33"><div align="right"></div></td>
<td colspan="3" bordercolor="#CCFF33" bgcolor="#CCFFFF"><div align="center" class="Stil6">
<div align="right"></div>
</div></td>
</tr>
<tr valign="baseline">
<td align="right" nowrap="nowrap" bordercolor="#CCFF33" bgcolor="#CCFF99"><div align="center" class="Stil3 Stil4">
<div align="right"><strong><?php echo $row_Recordset2['eins']; ?></strong>
<input type="text" name="einsanzahl" value="<?php echo htmlentities($row_Recordset1['einsanzahl'], ENT_COMPAT, 'utf-8'); ?>" size="5" />
</div>
</div></td>
<td nowrap="nowrap" bordercolor="#CCFF33" bgcolor="#CCFF00"><div align="center" class="Stil5">
<div align="right"><strong><?php echo $row_Recordset2['zwei']; ?></strong>
<input type="text" name="zweianzahl" value="<?php echo htmlentities($row_Recordset1['zweianzahl'], ENT_COMPAT, 'utf-8'); ?>" size="5" />
</div>
</div></td>
<td nowrap="nowrap" bordercolor="#CCFF33" bgcolor="#CCFF99"><div align="center" class="Stil5">
<div align="right"><strong><?php echo $row_Recordset2['drei']; ?></strong>
<input type="text" name="dreianzahl" value="<?php echo htmlentities($row_Recordset1['dreianzahl'], ENT_COMPAT, 'utf-8'); ?>" size="5" />
</div>
</div></td>
<td nowrap="nowrap" bordercolor="#CCFF33" bgcolor="#CCFF00"><div align="center" class="Stil5">
<div align="right">
<strong><?php echo $row_Recordset2['vier']; ?></strong>
<input type="text" name="vieranzahl" value="<?php echo htmlentities($row_Recordset1['vieranzahl'], ENT_COMPAT, 'utf-8'); ?>" size="5" />
</div>
</div></td>
<td nowrap="nowrap" bordercolor="#CCFF33" bgcolor="#CCFF99"><div align="center" class="Stil5">
<div align="right"><?php echo $row_Recordset2['fuenf']; ?>
<input type="text" name="fuenfanzahl" value="<?php echo htmlentities($row_Recordset1['fuenfanzahl'], ENT_COMPAT, 'utf-8'); ?>" size="5" />
</div>
</div></td>
<td width="147" nowrap="nowrap" bordercolor="#CCFF33" bgcolor="#CCFF00"><div align="center" class="Stil5">
<div align="right"><?php echo $row_Recordset2['sechs']; ?>
<input type="text" name="sechsanzahl" value="<?php echo htmlentities($row_Recordset1['sechsanzahl'], ENT_COMPAT, 'utf-8'); ?>" size="5" />
</div>
</div></td>
<td width="157" nowrap="nowrap" bordercolor="#CCFF33" bgcolor="#CCFF99"><div align="center" class="Stil5">
<div align="right"><?php echo $row_Recordset2['sieben']; ?>
<input type="text" name="siebenanzahl" value="<?php echo htmlentities($row_Recordset1['siebenanzahl'], ENT_COMPAT, 'utf-8'); ?>" size="5" />
</div>
</div></td>
<td width="188" nowrap="nowrap" bordercolor="#CCFF33" bgcolor="#CCFF00"><div align="center" class="Stil5">
<div align="right"><?php echo $row_Recordset2['acht']; ?>
<input type="text" name="achtanzahl" value="<?php echo htmlentities($row_Recordset1['achtanzahl'], ENT_COMPAT, 'utf-8'); ?>" size="5" />
</div>
</div></td>
</tr>
<tr valign="baseline">
<td height="25" align="right" nowrap="nowrap" bordercolor="#CCFF33" bgcolor="#CCFF00"><div align="center" class="Stil5">
<div align="right"><?php echo $row_Recordset2['neun']; ?>
<input type="text" name="neunanzahl" value="<?php echo htmlentities($row_Recordset1['neunanzahl'], ENT_COMPAT, 'utf-8'); ?>" size="5" />
</div>
</div></td>
<td nowrap="nowrap" bordercolor="#CCFF33" bgcolor="#CCFF99"><div align="center" class="Stil5">
<div align="right"><?php echo $row_Recordset2['zehn']; ?>
<input type="text" name="zehnanzahl" value="<?php echo htmlentities($row_Recordset1['zehnanzahl'], ENT_COMPAT, 'utf-8'); ?>" size="5" />
</div>
</div></td>
<td nowrap="nowrap" bordercolor="#CCFF33" bgcolor="#CCFF00"><div align="center" class="Stil5">
<div align="right"><?php echo $row_Recordset2['elf']; ?>
<input type="text" name="elfanzahl" value="<?php echo htmlentities($row_Recordset1['elfanzahl'], ENT_COMPAT, 'utf-8'); ?>" size="5" />
</div>
</div></td>
<td nowrap="nowrap" bordercolor="#CCFF33" bgcolor="#CCFF99"><div align="center" class="Stil5">
<div align="right"><?php echo $row_Recordset2['zwoelf']; ?>
<input type="text" name="zwoelfanzahl" value="<?php echo htmlentities($row_Recordset1['zwoelfanzahl'], ENT_COMPAT, 'utf-8'); ?>" size="5" />
</div>
</div></td>
<td nowrap="nowrap" bordercolor="#CCFF33" bgcolor="#CCFF00"><div align="center" class="Stil5">
<div align="right"><?php echo $row_Recordset2['dreizehn']; ?>
<input type="text" name="dreizehnanzahl" value="<?php echo htmlentities($row_Recordset1['dreizehnanzahl'], ENT_COMPAT, 'utf-8'); ?>" size="5" />
</div>
</div></td>
<td nowrap="nowrap" bordercolor="#CCFF33" bgcolor="#CCFF99"><div align="center" class="Stil5">
<div align="right"><?php echo $row_Recordset2['vierzehn']; ?>
<input type="text" name="vierzehnanzahl" value="<?php echo htmlentities($row_Recordset1['vierzehnanzahl'], ENT_COMPAT, 'utf-8'); ?>" size="5" />
</div>
</div></td>
<td nowrap="nowrap" bordercolor="#CCFF33" bgcolor="#CCFF00"><div align="center" class="Stil5">
<div align="right"><?php echo $row_Recordset2['fuenfzehn']; ?>
<input type="text" name="fuenfzehnanzahl" value="<?php echo htmlentities($row_Recordset1['fuenfzehnanzahl'], ENT_COMPAT, 'utf-8'); ?>" size="5" />
</div>
</div></td>
<td nowrap="nowrap" bordercolor="#CCFF33" bgcolor="#CCFF99"><div align="center" class="Stil5">
<div align="right"><?php echo $row_Recordset2['sechzehn']; ?>
<input type="text" name="sechzehnanzahl" value="<?php echo htmlentities($row_Recordset1['sechzehnanzahl'], ENT_COMPAT, 'utf-8'); ?>" size="5" />
:</div>
</div></td>
</tr>
<tr valign="baseline">
<td height="44" colspan="8" align="right" nowrap="nowrap" bordercolor="#CCFF33"><div align="right"> Bemerkungen
<input type="text" name="bemerkung" value="<?php echo htmlentities($row_Recordset1['bemerkung'], ENT_COMPAT, 'utf-8'); ?>" size="100" />
<input type="hidden" name="ID" value="<?php echo $row_Recordset1['ID']; ?>" />
<input type="hidden" name="MM_update" value="form2" />
<input type="hidden" name="ID" value="<?php echo $row_Recordset1['ID']; ?>" />
<input type="submit" value="Datensatz aktualisieren" />
: </div></td>
</tr>
</table>
<p> </p>
</form>
<?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>
</body>
</html>
<?php
mysql_free_result($Recordset2);
mysql_free_result($Recordset3);
mysql_free_result($Recordset1);
?>