| [SQL] UPDATE ??? | |
|
Von: Sniper-Hawk **** am 14.04.2007 ich hmal wieder eine frage bezüglich diesem newsscript.. in der zeit bin ich auch schon weiter gekommen (kommentare löschen / alle löschen usw.) Jetzt will ich die Beiträge bzw News "Editieren" können.. Nur es kommt mir nen Fehler bei dem code hier: $titel_e = $_POST['titel']; $inhalt_e = $_POST['titel']; $ID = $_GET['postid']; $update = "UPDATE News SET titel = '$titel_e', inhalt = '$inhalt_e', WHERE ID = $ID;"; $success = mysql_query($update); if(!$success) { echo mysql_error(); } ?> Fehler: Zitat 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 'WHERE ID = 2' at line 6 Ich versteh nicht.. ich hab das nach der Syntax wies im Tutoral hier -> http://tut.php-q.net/mysql-update.html stand ! Was ist jetzt daran Falsch.. MFG TOMEK | |
|
Antwort 1 von JoSsiF ***** am 14.04.2007 | |
|
Antwort 2 von Sniper-Hawk **** am 14.04.2007 soo simple.. sorry.. ich müsstes eigentlich selbst finden.. nochmalls sorry | |
|
Antwort 3 von Der olle Schwoebel ***** am 14.04.2007 <?php $titel_e = $_POST['titel']; $inhalt_e = $_POST['titel']; $ID = $_GET['postid']; $update = "UPDATE `News` SET `titel` = '".$titel_e."', `inhalt` = '".$inhalt_e."', WHERE `ID` = ".$ID; $success = mysql_query($update); if(!$success) { echo mysql_error(); } | |
| « zurück | Antworten |