php删除行不起作用

时间:2018-02-08 21:59:03

标签: php mysql

代码工作,没有错误....

$id = $_GET["id"];
$title = mysqli_real_escape_string($dbc, $_GET["title"]);
$who_post = mysqli_real_escape_string($dbc, $_GET["who_post"]);
$time = mysqli_real_escape_string($dbc, $_GET["time"]);
$type = mysqli_real_escape_string($dbc, $_GET["type"]);

include("../assets/php/connect.php");

//Removing from all project database
$q = "DELETE FROM all_projects WHERE id = '$id'";
if (mysqli_query($dbc, $q)) {
    echo "Record deleted successfully";
} else {
    echo "Error deleting record: " . mysqli_error($dbc);
}

//Removing from last posted database
$q = "DELETE FROM last_posted_project WHERE title = '$title' AND who_post = '$who_post' AND time_posted = '$time'";
if (mysqli_query($dbc, $q)) {
    echo "Record deleted successfully";
} else {
    echo "Error deleting record: " . mysqli_error($dbc);
}

//Removing from specific database
$q = "DELETE FROM site_templates WHERE name = '$title' AND who_post = '$who_post' AND time_post = '$time'";
if (mysqli_query($dbc, $q)) {
    echo "Record deleted successfully";
} else {
    echo "Error deleting record: " . mysqli_error($dbc);
}

但不删除行...始终为“记录已成功删除” 我尝试使用mysqli_real_escape_string,但没有...

0 个答案:

没有答案