Hallo, ich habe
Nun zeigt er leider für jeden Datensatz in der Datenbank das Formular an. Ich will aber nur ein Formular der vorher übergebenen ID Angezeigt wird.. Was habe ich Falsch?
LG
PHP-Code:
<?php
{
include("config.php");
include("header.tpl");
}
{
$id = $_GET['id'];
$ergebnis = mysql_query("SELECT * FROM news");
}
while($row = mysql_fetch_object($ergebnis))
{
echo "<form action=\"speichern.php\" method=\"post\">";
echo "<input type=\"hidden\" name=\"sid\" value=\"$id\">";
echo "<table>";
echo "<tr>";
echo "<td>Betreff</td>";
echo "<td><input type=\"text\" size=\"17\" name=\"sbetreff\" value=\"";
echo $row->betreff;
echo "\" class=\"form\"></td>";
echo "</tr>";
echo "<tr>";
echo "<td>Eintrag</td>";
echo "<td><textarea type=\"text\" size=\"17\" name=\"skommentar\">";
echo $row->kommentar;
echo "</textarea></td>";
echo "</tr>";
echo "<tr>";
echo "<td></td>";
echo "<td><input type=\"submit\" value=\"Speichern\"></td>";
echo "</tr>";
echo "</table>";
echo "</form>";
}
{
include("footer.tpl");
}
?>
LG
Kommentar