I'm trying to create a form that can remove news stories from a MySQL database.
My script goes like this:
<html>
<head>
<title>Administrative Options - Edit/Delete News Story</title>
<?php
if ($submit) {
// process form
$connection = mysql_connect("localhost","bornrun","");
mysql_select_db("bornrun_uk_db",$connection);
$sql = "DELETE FROM 'news' WHERE 'id'='$id'";
$result = mysql_query($sql);
echo "The news story has been removed from the site.\n";
} else {
// display form
?>
</head>
<?php
$db = mysql_connect("localhost","bornrun","");
mysql_select_db("bornrun_uk_db",$db);
$request = "SELECT * FROM news order by id desc".$id;
$result = mysql_query($request);
?>
<body bgcolor="#c0c0c0">
<?php
while ($row = mysql_fetch_array($result)) {
?>
<center>
<font size="2" color="#ff0000" face="Arial"><b>
<?php echo $row['headline']; ?>
</b></font> -
<font size="1" color="#000000" face="Arial">
<?php echo $row['date']; ?>
</font>
<br />
<font size="2" color="#000000" face="Arial">
<?php echo $row['leader']; ?>
<br />
<br />
<input type="hidden" name="id" value="$id">
<input type="submit" name="submit" value="Delete">
 
 
 
<input type="submit" name="edit" value="Edit">
<br />
<hr />
<br />
</center>
</form>
<?php
}
}
?>
</body>
</html>
However, when I press the 'Delete' button absolutely nothing happens!
Any help would be much appreciated.
Cheers,
Bailz.