いくつかのレコードを含む SQL データベースを作成しました。そのレコードを表示するテーブルがあります。私の質問は、このレコードを削除する方法です。コードを作成しましたが、間違っています。助言がありますか?
テーブル:
<?php                                               
$result = mysql_query("SELECT id,onoma_pelati,tilefono,fax,email FROM visitors");
if (!$result) {
    die("Problem...");
}
$fields_num=mysql_num_fields($result);                                  
$counter = 1;
while($row = mysql_fetch_row($result))
{
    echo "<tr>";
    echo "<td>" . $counter . "</td>";
    foreach($row as $cell)
    {
        echo "<th>$cell</th>";
    }
    echo '<td class="column"> 
       <a href="delete.php?id=' . $row['id'] . '"><img src="images/icons/color/cross.png" /></a> </td></tr>';                                       
    $counter++;
}
mysql_free_result($result);
?>
そして削除ファイル:
<?php
include('db_connection.php');
if (isset($_GET['id']) && is_numeric($_GET['id']))
{
    $id = $_GET['id'];
    $result = mysql_query("DELETE FROM visitors WHERE id=$id")
    or die(mysql_error());
    header("Location: showplio.php");
}
else
{
    header("Location: addplio.php");
}
?>