I'm using php to delete a row from a table in a database in mysql, but it's not working. I'm not even trying to do anything fancy, just delete one row. Here's the code:
mysql_query("DELETE FROM feed WHERE feed = '$feed'") or die("Query failed! with '$feed'");
This just doesn't work while this does
mysql_query("DELETE FROM feed WHERE feed = 'hello'") or die("Query failed! with '$feed'");
Please help me...
Complete code (based on comment below):
$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); )
Try this... add the curly braces around your $feed variable