我在从数据库中删除一行时遇到问题;连接是绝对正常的,因为我已经用其他东西测试了它,变量$first
包含要删除的正确ID。
<?php
if (isset($_GET['production'])) {
$production = $_GET['production'];
$arr = explode(".", $production, 2);
$first = $arr[0];
$filename = "Productions/$first.php";
echo $first;
if(file_exists($filename)==true){
$str2 = "DELETE FROM production WHERE production_id = '$first'";
if($mysqli->query($str2)==true){
echo "Successfully deleted $first";
unlink($filename);
}
}
}
?>