我正在使用 php 从 mysql 数据库中的表中删除一行,但它不起作用。我什至不想做任何花哨的事情,只是删除一行。这是代码:
mysql_query("DELETE FROM feed WHERE feed = '$feed'") or die("Query failed! with '$feed'");
这只是行不通,而这样做
mysql_query("DELETE FROM feed WHERE feed = 'hello'") or die("Query failed! with '$feed'");
请帮我...
完整代码(基于下面的评论):
$feed = $_POST['feed'];
$date = $_POST['date'];
$time = $_POST['time'];
echo $feed;
echo $date;
echo $time;
//$r = mysql_query("DELETE FROM feed WHERE date = '$date' AND time = '$time'") or die("Query failed! with '$feed'");
$r = mysql_query ("DELETE FROM feed WHERE feed = '" . mysql_real_escape_string ($feed) . "'") or die ("Query failed with {$feed} and mysql error: " . mysql_error); )