Also aktualisieren kann ich!! ..... und mit PhP üb ich ja noch ich stell euch den ganzen Code mal rein. Ich scheine jetzt irgendwas richtig gemacht zu haben denn er meckert nicht mehr über Zeile 79 sondern über 71:
PHP:<?php error_reporting(0); $id =$_GET["id"]; include("include.php"); if($id != "") { $sql="SELECT id, text, ueberschrift, aufmacher, datum. autor, kategorie FROM news WHEREid=" . mysql_escape_string($id); $result=mysql_query($swl); $row=mysql_fetch_array ($result); } ?> <html> <head> <title>Artikel eingeben</title> <link rel="StyleSheet" type="text/css" href="styles.css"/> </head> <body> <form action="speichern.php" method="get"> <table border="0" border="1" class="xmpcode" cellpadding="3"> <tr> <td><b>Überschrift</b></td> <td> <input name="ueberschrift" type="text" maxlength="80" size="80" value="<?php echo $row[2] ?>"/> </td> </tr> <tr> <td><b>Datum</b></td> <td> <input name="datum" type="text" maxlength="10" size="10" value="<?php echo date("d M Y") ?>"/"> </td> </tr> <tr> <td> <b> Autor</b> </td> <td> <input name="autor" type="text" maxlength="10" size="10" value="<?php echo $row[5] ?>"/> </td> </tr> <tr> <td><b>Aufmacher</b></td> <td> <textarea name="aufmacher" cols="50" rows="7"> <?php echo $row[3] ?> </textarea> </td> </tr> <tr> <td valign="top"><b>Text</b></td> <td> <textarea name="text" cols="50" rows="15"> <?php echo $row[1] ?> </textarea> </td> </tr> <tr> <td>Kategorie</td> <td> <select name="kategorie"> <?php $resultss = mysql_query ("SELECT Name, ID FROM kategorien WHERE ID= $row[6]"); while ($rowss = mysql_fetch_object ($resultss)) { echo "<option selected value='; echo $rowss -> ID; echo '">; echo $rowss -> Name; echo "</option>"; } $result = mysql_query("SELECT Name, ID FROM kategorien"); $menge = mysql_num_rows($result); while($rows = mysql_fetch_row($result)) { echo '<option value='; echo $rows[1]; echo '">"; echo $rows[0]; echo "</option>"; }?> </select> </td> </tr> </table> </br> <input type="hidden" name=id value="<?php echo $id ?>" /"> <input type="submit" value="Artikel speichern" /> </form> </body> </html>
PHP:
<?php
error_reporting(0);
$id =$_GET["id"];
include("include.php");
if($id != "")
{
$sql="SELECT id, text, ueberschrift, aufmacher, datum. autor, kategorie
FROM news WHEREid=" . mysql_escape_string($id);
$result=mysql_query($swl);
$row=mysql_fetch_array ($result);
}
?>
<html>
<head>
<title>Artikel eingeben</title>
<link rel="StyleSheet" type="text/css" href="styles.css"/>
</head>
<body>
<form action="speichern.php" method="get">
<table border="0" border="1" class="xmpcode" cellpadding="3">
<tr>
<td><b>Überschrift</b></td>
<td>
<input name="ueberschrift" type="text" maxlength="80"
size="80" value="<?php echo $row[2]; ?>"/>
</td>
</tr>
<tr>
<td><b>Datum</b></td>
<td>
<input name="datum" type="text" maxlength="10"
size="10" value="<?php echo date("d M Y"); ?>"/">
</td>
</tr>
<tr>
<td>
<b> Autor</b>
</td>
<td>
<input name="autor" type="text" maxlength="10"
size="10" value="<?php echo $row[5]; ?>"/>
</td>
</tr>
<tr>
<td><b>Aufmacher</b></td>
<td>
<textarea name="aufmacher" cols="50" rows="7">
<?php echo $row[3]; ?>
</textarea>
</td>
</tr>
<tr>
<td valign="top"><b>Text</b></td>
<td>
<textarea name="text" cols="50" rows="15">
<?php echo $row[1]; ?>
</textarea>
</td>
</tr>
<tr>
<td>Kategorie</td>
<td>
<select name="kategorie">
<?php
$resultss = mysql_query
("SELECT Name, ID FROM kategorien WHERE ID= $row[6]");
while ($rowss = mysql_fetch_object ($resultss))
{
echo '<option selected value="';
echo $rowss -> ID;
echo '">';
echo $rowss -> Name;
echo "</option>";
}
$result = mysql_query("SELECT Name, ID FROM kategorien");
$menge = mysql_num_rows($result);
while($rows = mysql_fetch_row($result))
{
echo '<option value="';
echo $rows[1];
echo '">';
echo $rows[0];
echo "</option>";
}?>
</select>
</td>
</tr>
</table>
</br>
<input type="hidden" name=id value="<?php echo $id; ?>" /">
<input type="submit" value="Artikel speichern" />
</form>
</body>
</html>
Besser?