Habe sehr viele Tips von Euch bekommen und auch alles hinbekommen - außer daß die "ID" keinen Inhalt hat. Es erscheint immer noch die Meldung: "Hat nicht geklappt"
Bitte nochmal um Eure Mühe.
Hauptteil:
Abteilung bearbeiten:
Bitte nochmal um Eure Mühe.
Hauptteil:
Code:
<!doctype html public "-//w3c//dtd html 4.0//en">
<html>
<head>
</head>
<body bgcolor="#D5B4C4">
<font color = "#000000"> <center> <h1> Abteilungen </center></font> <h3>
<?php
$db=mysql_connect("localhost","basler","hkw4191");
mysql_select_db("bvw");
$anfrage="SELECT * FROM t_abteilung ORDER BY Abteilung;";
$ergebnis=mysql_query($anfrage);
print("<table border='1' bordercolor='4254F5' align='center'>");
print("<td></td>");
print("<td></td>");
print("<td></td>");
for($i=1; $i<=1;$i++){
print("<th>");
print("<h5>");
print(mysql_field_name($ergebnis,$i));
print("</th>");
}
while($zeile=mysql_fetch_array($ergebnis)){
print("<tr align='center'>");
print("<td> [img]button_insert.png[/img] </td>");
print("<td> [img]button_edit.png[/img] </td>");
print("<td> [img]button_drop.png[/img]</td>");
for($i=1;$i<=1;$i++){
print("<td>");
print("<h5>");
print($zeile[$i]);
print("</td>");
}
print("</tr>");
}
print("</table>");
mysql_close($db);
?>
</body>
</html>
Code:
<!doctype html public "-//w3c//dtd html 4.0//en">
<html>
<head>
</head>
<body>
<?php
$db=mysql_connect("localhost","basler","hkw4191");
mysql_select_db("bvw");
$anfrage="SELECT * FROM t_abteilung ORDER BY Abteilung;";
$ergebnis=mysql_query($anfrage);
if($_GET['action']=="delete")
{
$id=$_GET['id'];
$delete_SQL="DELETE FROM t_abteilung WHERE Abteilung_ID=$id";
$result=mysql_query($delete_SQL) or die("Hat nicht geklappt");
}
mysql_close($db);
?>
</body>
</html>

Kommentar