是否有办法将两条价值观从一例下降的菜单中加到Mysql?
插入形式值的神秘q星例子如下:
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
$insertSQL = sprintf("INSERT INTO menu (food, image_extension) VALUES (%s, %s)",
GetSQLValueString($_POST[ food ], "text"),
GetSQLValueString($_POST[ image_extension ], "text"),
mysql_select_db($database_menu, $menu);
$Result1 = mysql_query($insertSQL, $menu) or die(mysql_error());
$insertGoTo = "menu.php?status=choosen";
if (isset($_SERVER[ QUERY_STRING ])) {
$insertGoTo .= (strpos($insertGoTo, ? )) ? "" : "?";
$insertGoTo .= $_SERVER[ QUERY_STRING ];
}
header(sprintf("Location: %s", $insertGoTo));
}
I m trying to insert values of 2 columns (food & image_extension) from each selected tag of the following dropdown list to MySql but it can t insert data to image_extension column. It only update food column.
<select name="food, image extension" class="dropdownmenu" input id="food" value="<?php echo $_POST[ food ].$_POST[ image_extension ]; ?>">
<option value="selected="selected">Select Food</option>
<option value="Pizza, pizza.jpg">Pizza</option>
<option value="French Fry frenchfry.jpg">French Fry</option>
</select>
I m confused about how to put values in the following three attributes of the above dropdown list properly in this case?
1. <select name="food, image extension"
2. <select value="<?php echo $_POST[ food ].$_POST[ image_extension ]; ?>"
3. <option value="Pizza, pizza.jpg">Pizza</option>
任何准则都应受到高度评价。