Hi...!
Also ich hab ein Script welches eigentlich daten ändern soll bloß dieses tut es nicht...!
die $id wird von der vorherigen datei mit gesendet den rest zieht sich das script aus der myscl datenbank...!
PHP-Code:
<?
include ("../db.php");
if ($button==" OK ") {
mysql_query("UPDATE news SET ueberschrift='".$_POST['ueberschrift']."', text='".$_POST['text']."', autor='".$_POST['autor']."', datum='".$_POST['datum']."' WHERE id=".$_POST['id']."");
mysql_close();
?>
<table width="300" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#20577D">
<tr>
<td><table width="300" border="0" cellpadding="5" cellspacing="0" bgcolor="#5F81A0">
<tr>
<td colspan="2" bgcolor="#2323B1" class="ueberschrift2-W">Achtung</td>
</tr>
<tr>
<td colspan="2" class="fliesstext-W">
Die Daten wurden eingetragen</p>
</td>
</tr>
<tr>
<td class="fliesstext-W">[url="fechtarr.php"]zur Übersicht[/url]</td>
<td class="fliesstext-W"><a href="insert.php" class="fliesstext-W">Neuer
Eintrag</a></td>
</tr>
</table>
</td>
</tr>
</table>
<?
}
else {
$query = "SELECT * FROM news WHERE id='".$_POST['id']."" or die("MySQL-Error:".mysql_error());
$result = mysql_query($query) or die("MySQL-Error:".mysql_error());
$line = mysql_fetch_array($result) or die("MySQL-Error:".mysql_error());
?>
<form method="post" action="update.php?id=<? echo"$id"; ?></form>$id">
<table width="80%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#20577D">
<tr>
<td><table width="100%" border="0" cellpadding="5" cellspacing="0" bgcolor="#5F81A0">
<tr>
<td colspan="2" bgcolor="#2323B1" class="ueberschrift1-W">Editieren</td>
</tr>
<tr>
<td colspan="2"><input name="interpret" type="text" class="textbutton" value="<? echo"$line[ueberschrift]"; ?>">
</td>
</tr>
<tr>
<td colspan="2"><input name="titel2" type="text" class="textbutton" value="<? echo"$line[text]"; ?>">
</td>
</tr>
<tr>
<td width="40%"><input name="titel3" type="text" class="textbutton" value="<? echo"$line[datum]"; ?>">
</td>
<td width="60%"><input name="titel" type="text" class="textbutton" value="<? echo"$line[autor]"; ?>">
</td>
</tr>
<tr>
<td valign="bottom" class="fliesstext">[url="fechtarr.php"]zur Übersicht[/url]</td>
<td><div align="right">
<input name="button" type="submit" class="searchbutton" value=" OK ">
</div>
</td>
</tr>
</table>
</td>
</tr>
</table>
</form>
<?
}
?>
könnt ihr mir bitte weiterhelfen würde mich riesig freuen...!
achja fehler meldung ist
MySQL-Error:You have an error in your SQL syntax; check the manual that corresponds to your
MySQL server version for the right syntax to use near '' at line 1
thx