I'm trying to make a script to delete a row from a mysql table ......
Can someone tell me what's wrong ??!?
Please take a look on the last 7 lines .. without them it works (but the script is not complete)
PHP Code:
<form method="get" action="update.php">
<?
mysql_pconnect("localhost","username","password");
mysql_select_db("databasename");
if(!$submit)
{
$result = mysql_query("select * from poly_links order by id");
while($r=mysql_fetch_array($result))
{
$id=$r["id"];
$songname=$r["songname"];
$author=$r["author"];
?>
<INPUT TYPE="RADIO" NAME="id" VALUE="<?php echo $id;?>"><br>
<?php echo $id;?>
<?php echo $songname;?>
<?php echo $author;?><br>
<?
}?>
<input type="submit" value="submit" name="Submit"></form>
<?
}?>
<?
else
{
$sql = "DELETE FROM poly_links WHERE id=$id";
$result = mysql_query($sql);
echo "News Deleted.";
}?>