Hey everyone, 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:
<?
include 'config.php';
$recordid = $_POST['recordid'];
echo $recordid;
mysql_query("DELETE FROM employees WHERE recordid='$recordid'")
or die('sorry, no query');
echo "You have successfully deleted the user."
?>
The database is connecting properly, I double checked that. The variable $recordid is echoing out properly, and I even tried not using the variable, and just placing the actual number of the record id in the code instead, but still didn't work. And yes, I did try copying and pasting that code directly in to the mysql command line. Works perfectly no errors. So how come the query never works? The query dies every time, no fail, but works every time when I use the exact same command in the mysql command line, straight copy and paste, no kidding.
Any ideas? I know it's going to be something stupid, and I'm going to kick myself when I find out, but it's killing me!