Sascha: Datensatz löschen

Beitrag lesen

Guten Morgen,
kann mir vielleicht jemand helfen? Ich versuche vergeblich einen Datensatz zu löschen. Warum klappt das nicht?

<HTML>
<HEAD>
<TITLE>Newseditor</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
</HEAD>
<?
include("datenbank.php");
// Datensatz löschen
if ($delete==1){
$result=mysql_query("select * from sc_news where id=$id");
 mysql_query("DELETE FROM sc_news WHERE id=$id LIMIT=1");
 }
?>
<BODY BGCOLOR="#FFFFFF">
<H1>Newseditor - Auswahl</H1>
<table>
  <?

$result=mysql_query("select id,titel,bild from sc_news");
    while($row=mysql_fetch_array($result)) {
    $id=$row["id"];
 $titel=$row["titel"];
    $bild=$row["bild"];
     ?>
  <tr valign="top" bgcolor="#CCCCCC">
    <td><? echo $titel ?></td>
    <td>
      <? if($bild) { ?>
      <img src="<? echo $bildurl.$bild ?>">
      <? } else { ?>
      Kein Bild vorhanden
      <? } ?>
    </td>
    <td><a href="<? echo "formular.php?id=$id" ?>">Bearbeiten</a></td>
 <td><a href="<? echo "$PHP_SELF?delete=1&id=$id" ?>">Löschen</a></td>
  </tr>
  <? } ?>
</table>
</BODY>
</HTML>