尝试使用sql查询从表中删除条目时出错。 reserveName是一个字符串
if(isset($_POST['delete'])) {
$sql=("DELETE FROM reserve WHERE reserveName='$dropdownID'");
if (!mysql_query($conn, $sql))
{
die('Error: ' . mysql_error(). $dropdownID);
}
echo "1 record deleted go back to delete another!";
}
以下是代码设置$ dropdownID
if(isset($_POST['dropdown'])) {
$_SESSION['dropdown'] = $_POST['dropdown'];
$dropdownID = $_SESSION['dropdown'];
}
if(isset($_SESSION['dropdown'])) {
$dropdownID = $_SESSION['dropdown'];
}
这与给出的副本不同,因为它是布尔数据类型,并且是通过本地主机完成的。