使用PHP删除行但有时只能工作

时间:2015-03-17 21:33:00

标签: php html database rows

我在从数据库中删除一行时遇到问题;连接是绝对正常的,因为我已经用其他东西测试了它,变量$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);
            }
        }
    }
?>

0 个答案:

没有答案