我正在尝试从 php 中的 MYSQL 数据库中删除某个选定的值。
[删除.php]
<form name="delete" method="POST" action="d3l3t3d.php">
<select name="eBox" id="nname" style="width: 290px; height:40px;">
<?php
mysql_connect("a","b","") or die("Wrong username or password");
mysql_select_db("TABLE") or die( "Unable to select database");
$query = "Select * From list";
$result = mysql_query($query);
while ($row = mysql_fetch_array($result))
{
$name = $row['name'];
echo "<option>" . $name . "</option>";
}
echo "</select><br/><br/>"
?>
[d3l3t3d.php]
<?php
$namez = $_POST['nname'];
$name = mysql_real_escape_string($namez);
mysql_connect("a","b",
"") or die("Wrong username or password");
mysql_select_db("TABLE") or die( "Unable to select database");
mysql_query("DELETE FROM list WHERE name='$name'");
?>
我收到以下错误:
注意:未定义索引:第 2 行 C:\xampp\htdocs\folder\d3l3t3d.php 中的 nname