AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Programmieren allgemein Php - MySQL-Datensatz löschen Fehlersuche!
Thema durchsuchen
Ansicht
Themen-Optionen

Php - MySQL-Datensatz löschen Fehlersuche!

Ein Thema von Grolle · begonnen am 22. Mär 2006 · letzter Beitrag vom 22. Mär 2006
 
Grolle

Registriert seit: 5. Nov 2004
Ort: Coesfeld
1.268 Beiträge
 
Delphi 2010 Professional
 
#1

Php - MySQL-Datensatz löschen Fehlersuche!

  Alt 22. Mär 2006, 13:55
Hallo!
Ich wähle mit folgendem Script einen Datensatz aus:
Delphi-Quellcode:
<form action = "del2.php" method = "post">
<?php
  include "connect.inc.php";
  $res = mysql_query("select * from adressbuch");
  $num = mysql_num_rows($res);

  echo '<table border="1" cellspacing="0" bordercolordark="white" bordercolorlight="black">';
  echo '<tr> <td>

<font face="Arial" size="2">Auswahl</font></p></td> <td>

<font face="Arial" size="2">Name</font></p></td>
';
  echo '<td>

<font face="Arial" size="2">Vorname</font></p></td> <td>

<font face="Arial" size="2">Strasse</font></p></td>
';
  echo '<td>

<font face="Arial" size="2">PLZ</font></p></td> <td>

<font face="Arial" size="2">Wohnort</font></p></td>
';
  echo '<td>

<font face="Arial" size="2">Telefon</font></p></td> <td>

<font face="Arial" size="2">Fax</font></p></td>
';
  echo '<td>

<font face="Arial" size="2">Mobil</font></p></td> <td>

<font face="Arial" size="2">E-Mail</font></p></td>
';

  while ($dsatz = mysql_fetch_assoc($res))
     {
        echo "<tr>";
        echo "<td><input type='radio' name='auswahl' value='" . $dsatz["name"] . "'></td>";
        echo '<td>

<font face="Arial" size="2">' . $dsatz["name"] . "</font></p></td>";
        echo '<td>

<font face="Arial" size="2">' . $dsatz["vorname"] . "</font></p></td>";
        echo '<td>

<font face="Arial" size="2">' . $dsatz["strasse"] . "</font></p></td>";
        echo '<td>

<font face="Arial" size="2">' . $dsatz["plz"] . "</font></p></td>";
        echo '<td>

<font face="Arial" size="2">' . $dsatz["wohnort"] . "</font></p></td>";
        echo '<td>

<font face="Arial" size="2">' . $dsatz["telefon"] . "</font></p></td>";
        echo '<td>

<font face="Arial" size="2">' . $dsatz["fax"] . "</font></p></td>";
        echo '<td>

<font face="Arial" size="2">' . $dsatz["mobil"] . "</font></p></td>";
        echo '<td>

<font face="Arial" size="2">' . $dsatz["mail"] . "</font></p></td>";
        echo "</tr>";

     }


  // Tabellenende
  echo "</table>";

?>
   



   <input type="submit" value="Datensatz l&ouml;schen">

</form>
Die del2.php die den Datensatz eigentlich löscht sieht so aus:
Delphi-Quellcode:
<html>

<head>
<title>MD Adressbuch 2006 web</title>
</head>

<body>

<?php

if (isset($auswahl))
   {
      include "connect.inc.php";
      $sqlab = "delete from adressbuch where name = $auswahl";
      mysql_query($sqlab);
      $num = mysql_affected_rows();
      if ($num>0)
        echo "Der Datensatz wurde gelöscht!

";
      else
        echo "Der Datensatz wurde nicht gelöscht!

";
   }

else
  echo "Es wurde kein Datensatz ausgewählt!

";
?>

[url="del.php"]Weitere Datensätze löschen...[/url]




[url="index.php"]Zurück zur Übersicht...[/url]


</body>

</html>
Das Problem ist, dass der Datensatz nicht gelöscht wird. Das wird auch so angezeigt.
Wo liegt der Fehler?

Viele Grüße...

  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 15:23 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz