我试图使用这个 url 从数据库中删除一些东西:
siteurl.com/mail.php?action=delete&mail_id=10
使用此代码:
if ($action == delete) {
if(isset($_GET['id'])) {
$deleteid = $_GET['id'];
$sql = "DELETE FROM mail WHERE mail_id = ".$deleteid." LIMIT 1";
$query = mysql_query($sql);
header('Location: '.$_SERVER['HTTP_REFERER'].' ');
exit();
}
}
但它不起作用,它显示错误:Query was empty
怎么了?