Nun habe ich 7 Tabellen angelegt - für jeden user eine, und in jeder tabelle befinden sich 3 reihen: datum, was, wo
Meine frage ist nun wie ich bei dem eintragsformular ein dropdown menü nutze in dem dann die 7 user aufgelistet sind, damit der user sozusagen sich auswählt und damit das formluar weiß in welche tabelle der die eingetragenen daten schreiben soll.
Hier mein formular:
wär ne feine sache wenn mir jemand helfen könnte<?php require_once('Connections/ostcoderockerz_de.php'); ?>
<?php
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $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 = $HTTP_SERVER_VARS['PHP_SELF'];
if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) {
$editFormAction .= "?" . $HTTP_SERVER_VARS['QUERY_STRING'];
}
if ((isset($HTTP_POST_VARS["MM_insert"])) && ($HTTP_POST_VARS["MM_insert"] == "form1")) {
$insertSQL = sprintf("INSERT INTO 2face (datum, party, location) VALUES (%s, %s, %s)",
GetSQLValueString($HTTP_POST_VARS['datum'], "text"),
GetSQLValueString($HTTP_POST_VARS['party'], "text"),
GetSQLValueString($HTTP_POST_VARS['location'], "text"));
mysql_select_db($database_ostcoderockerz_de, $ostcoderockerz_de);
$Result1 = mysql_query($insertSQL, $ostcoderockerz_de) or die(mysql_error());
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Unbenanntes Dokument</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="layout.css" rel="stylesheet" type="text/css">
</head>
<body bgcolor="D7D3B1" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" style="background-image:url(pix/bg_main.gif); background-repeat:no-repeat; background-attachment:fixed;" class="main">
<form method="post" name="form1" action="<?php echo $editFormAction; ?>">
<table class="main">
<tr valign="baseline">
<td nowrap>Datum:</td>
<td><input type="text" name="datum" value="" size="32"></td>
</tr>
<tr valign="baseline">
<td nowrap>Party:</td>
<td><input type="text" name="party" value="" size="32"></td>
</tr>
<tr valign="baseline">
<td nowrap>Location:</td>
<td><input type="text" name="location" value="" size="32"></td>
</tr>
<tr valign="baseline">
<td nowrap align="right"> </td>
<td><input type="submit" value="Datensatz einfügen"></td>
</tr>
</table>
<input type="hidden" name="MM_insert" value="form1">
</form>
<p> </p>
</body>
</html>