View Single Post
Old 05-13-2003, 02:42 PM  
Gasper
Guest
 
Posts: n/a
PHP experts .. please help!!

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.";
}?>
  Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote