I am tring to delete a row form a news database. When I submit I get no errors but row doesn't delete. I tried to echo the "id" in the else statement but nothing displays so I am assuming that it is not making it there. Can anyone help? Thanks in advance!
Here is my code:
<form method="get" action="dbdelete.php">
<?
mysql_pconnect("192.168.1.27","root","pass");
mysql_select_db("test");
if(!$submit)
{
$result = mysql_query("select * from news order by id");
while($row=mysql_fetch_array($result))
{
$title=$row["title"];
$id=$row["id"];
?>
<INPUT TYPE="RADIO" NAME="id" VALUE="<?php echo $id;?>">
<?php echo $id;?>
<?php echo $title;?><br>
<?
}
?>
<input type="submit" value="submit" name="Submit"></form>
<?
}else{
echo $id;
$sql = "DELETE FROM news WHERE id=$id";
$result = mysql_query($sql);
echo "Record deleted!";
}
?>