PSD-Tutorials.de
Forum für Design, Fotografie & Bildbearbeitung
Tutkit
Agentur
Hilfe
Kontakt
Start
Forum
Aktuelles
Besonderer Inhalt
Foren durchsuchen
Tutorials
News
Anmelden
Kostenlos registrieren
Aktuelles
Suche
Suche
Nur Titel durchsuchen
Von:
Menü
Anmelden
Kostenlos registrieren
App installieren
Installieren
JavaScript ist deaktiviert. Für eine bessere Darstellung aktiviere bitte JavaScript in deinem Browser, bevor du fortfährst.
Du verwendest einen veralteten Browser. Es ist möglich, dass diese oder andere Websites nicht korrekt angezeigt werden.
Du solltest ein Upgrade durchführen oder einen
alternativen Browser
verwenden.
Antworten auf deine Fragen:
Neues Thema erstellen
Start
Forum
Sonstiges
Webdesign, Webentwicklung & Programmierung
PHP, Javascript, jQuery, Ajax, nodeJS, MySQL...
MySQL Syntax Fehler bei Eintragung - Find den Fehler nicht?
Beitrag
<blockquote data-quote="WebmasterHelp" data-source="post: 2110557"><p>Hallo,</p><p></p><p>bau grad ein Bestellformular in PHP welches die Daten in einer MySQL Datenbank speichern soll. Nun bekomme ich immer diesen Fehler:</p><p></p><p><em>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 'key) VALUES ('firma', ' at line 2</em></p><p></p><p>So sie der query aus:</p><p></p><p>[PHP]$render = sha1(mt_rand());</p><p>$key = substr($render, 0, 16);</p><p></p><p>$query = "INSERT INTO</p><p>customers (anrede, firma, vorname, nachname, anschrift, wohnort, land, lizenz, homepage, email, telefon, passwort, zahlung, bestellung, aktiv, key)</p><p>VALUES ('" . mysqli_real_escape_string($connect, trim($_POST['anrede'])) . "',</p><p>'" . mysqli_real_escape_string($connect, trim($_POST['firma'])) . "',</p><p>'" . mysqli_real_escape_string($connect, trim($_POST['vorname'])) . "',</p><p>'" . mysqli_real_escape_string($connect, trim($_POST['nachname'])) . "',</p><p>'" . mysqli_real_escape_string($connect, trim($_POST['anschrift'])) . "',</p><p>'" . mysqli_real_escape_string($connect, trim($_POST['wohnort'])) . "',</p><p>'" . mysqli_real_escape_string($connect, trim($_POST['land'])) . "',</p><p>'" . mysqli_real_escape_string($connect, trim($_POST['lizenz'])) . "',</p><p>'" . mysqli_real_escape_string($connect, trim($_POST['homepage'])) . "',</p><p>'" . mysqli_real_escape_string($connect, trim($_POST['email'])) . "',</p><p>'" . mysqli_real_escape_string($connect, trim($_POST['telefon'])) . "',</p><p>'" . mysqli_real_escape_string($connect, trim($_POST['passwort'])) . "',</p><p>'" . mysqli_real_escape_string($connect, trim($_POST['zahlung'])) . "',</p><p>NOW(),</p><p>'0',</p><p>'" . mysqli_real_escape_string($connect, $key) . "')";</p><p></p><p>$result = mysqli_query($connect, $query) OR die(mysqli_error($connect));[/PHP]</p><p></p><p>Weiß jemand Rat?</p><p>Mfg</p></blockquote><p></p>
[QUOTE="WebmasterHelp, post: 2110557"] Hallo, bau grad ein Bestellformular in PHP welches die Daten in einer MySQL Datenbank speichern soll. Nun bekomme ich immer diesen Fehler: [I]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 'key) VALUES ('firma', ' at line 2[/I] So sie der query aus: [PHP]$render = sha1(mt_rand()); $key = substr($render, 0, 16); $query = "INSERT INTO customers (anrede, firma, vorname, nachname, anschrift, wohnort, land, lizenz, homepage, email, telefon, passwort, zahlung, bestellung, aktiv, key) VALUES ('" . mysqli_real_escape_string($connect, trim($_POST['anrede'])) . "', '" . mysqli_real_escape_string($connect, trim($_POST['firma'])) . "', '" . mysqli_real_escape_string($connect, trim($_POST['vorname'])) . "', '" . mysqli_real_escape_string($connect, trim($_POST['nachname'])) . "', '" . mysqli_real_escape_string($connect, trim($_POST['anschrift'])) . "', '" . mysqli_real_escape_string($connect, trim($_POST['wohnort'])) . "', '" . mysqli_real_escape_string($connect, trim($_POST['land'])) . "', '" . mysqli_real_escape_string($connect, trim($_POST['lizenz'])) . "', '" . mysqli_real_escape_string($connect, trim($_POST['homepage'])) . "', '" . mysqli_real_escape_string($connect, trim($_POST['email'])) . "', '" . mysqli_real_escape_string($connect, trim($_POST['telefon'])) . "', '" . mysqli_real_escape_string($connect, trim($_POST['passwort'])) . "', '" . mysqli_real_escape_string($connect, trim($_POST['zahlung'])) . "', NOW(), '0', '" . mysqli_real_escape_string($connect, $key) . "')"; $result = mysqli_query($connect, $query) OR die(mysqli_error($connect));[/PHP] Weiß jemand Rat? Mfg [/QUOTE]
Bilder bitte
hier hochladen
und danach über das Bild-Icon (Direktlink vorher kopieren) platzieren.
Zitate einfügen…
Authentifizierung
Wenn ▲ = 7, ▼ = 3, ◇ = 2 und die Summe von ▲ und ▼ durch ◇ geteilt wird, was ist das Ergebnis?
Antworten
Start
Forum
Sonstiges
Webdesign, Webentwicklung & Programmierung
PHP, Javascript, jQuery, Ajax, nodeJS, MySQL...
MySQL Syntax Fehler bei Eintragung - Find den Fehler nicht?
Oben