Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Gzie jest błąd składniowy?
kry008
post
Post #1





Grupa: Zarejestrowani
Postów: 12
Pomógł: 0
Dołączył: 11.12.2017

Ostrzeżenie: (10%)
X----


mam taką funkcję w php

$result = $dbh->exec('INSERT INTO ksiazka (numer_ksiazki, tytul_ksiazki, id_autor_1, id_autor_2, id_autor_3, id_autor_4, wydawnictwo_ksiazki, rok_wydania_ksiazki, opis_ksiazki, gatunek_ksiazki, wypozyczalna ) VALUES ( "'.$_GET['nr'].'" "'.$_GET['login'].'", "'.$_GET['a1'].'", "'.$_GET['a2'].'", "'.$_GET['a3'].'", "'.$_GET['a4'].'", "'.$_GET['wydawnictwo'].'", "'.$_GET['rok'].'", "'.$_GET['uwagi'].'", "'.$_GET['gatunek'].'", "'.$_GET['wypozyczalna'].')');
I mam taki komunikat

Fatal error: Uncaught PDOException: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '"1)' at line 1 in C:\xampp\htdocs\bib\a.php:28 Stack trace: #0 C:\xampp\htdocs\bib\a.php(28): PDO->exec('INSERT INTO ksi...') #1 {main} thrown in C:\xampp\htdocs\bib\a.php on line 28
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 19.08.2025 - 14:40