Einzelnen Beitrag anzeigen

Benutzerbild von fred.reichbier
fred.reichbier

Registriert seit: 27. Apr 2004
154 Beiträge
 
#1

[SQL + PHP] Wieso stimmt diese Query nicht?

  Alt 29. Aug 2005, 13:40
Hallo!

Ich verzweifle grade an einer MySQL-Query, die ich in PHP erstelle:

Code:
$query = 'INSERT INTO "voting" ("ID","IP","Name","Kommentar","Voting") ' .
            'VALUES("' . $_POST['ID'] . '", "0", "' . $_POST['Name'] . '", "' . $Kommentar . '", "' . $_POST['Voting'] . '")';
Wenn ich die Query ausgebe, sieht das so aus:

INSERT INTO "loewenzahnvoting" ("ID","IP","Name","Kommentar","Voting") VALUES("1", "0", "Test", "Testkommentar", "1") Und wenn ich das ganze dann mit mysql_query ausführe, kommt das:
Zitat:
1064: 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 '"voting" ("ID","IP","Name","Kommentar","Voting") VALU
Was mache ich da falsch?

Danke im Voraus,

Fred
Friedrich Weber
  Mit Zitat antworten Zitat