This is wierd because my code is written correctly and yet i am i am getting Couldn't execute query when i try to delete a record. I have the same code (execpt for the query functions) to modify a record and it works like a charm. Here is my code:
if (!$customer_id) {
header("Location:http://216.122.218.121/select_customer_to_delete.php");
exit;
}
$db_name = "test";
$table_name = "my_customers";
$connection = @mysql_connect("localhost", "usernamehere", "passwordhere") or die("Couldn't connect.");
$db = @mysql_select_db($db_name, $connection)or die("Couldn't select database.");
$sql = "DELETE FROM $table_name WHERE customer_id = \"$customer_id\"";
$result = @($sql,$connection) or die("Couldn't execute query.");
$display_block ="
<p><strong>The record has been successfully deleted
";
?>
<? echo "$display_block"; ?>
thanks for any help