Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [MySQL] błąd w zapytaniu mysql
emajl22
post
Post #1





Grupa: Zarejestrowani
Postów: 273
Pomógł: 21
Dołączył: 28.11.2010

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


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 '1')')' at line 1
  1. mysql_query("INSERT INTO `sms_codes` VALUES (null, '".implode("', '$typeid'),(null,'",$fp).", '$typeid')')") OR die(mysql_error());

co tu jest zle? zapytanie nie dodaje do bazy rekordow
Go to the top of the page
+Quote Post
skowron-line
post
Post #2





Grupa: Zarejestrowani
Postów: 4 340
Pomógł: 542
Dołączył: 15.01.2006
Skąd: Olsztyn/Warszawa

Ostrzeżenie: (0%)
-----


  1. echo "INSERT INTO `sms_codes` VALUES (null, '".implode("', '$typeid'),(null,'",$fp).", '$typeid')')";
i zobacz co pokaże się w przeglądarce.
Go to the top of the page
+Quote Post
sada
post
Post #3





Grupa: Zarejestrowani
Postów: 302
Pomógł: 24
Dołączył: 6.12.2008

Ostrzeżenie: (0%)
-----


nawiasy jak sądzę
Go to the top of the page
+Quote Post
emajl22
post
Post #4





Grupa: Zarejestrowani
Postów: 273
Pomógł: 21
Dołączył: 28.11.2010

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


skowron, tak juz robilem i co dziwne pokazuje ze wszystko jest ok i jak skopiuje wynik z echo i wkleje do pma to dziala...

  1. INSERT INTO `sms_codes` VALUES (NULL, 'xxx ', '1'),(NULL,'xxx ', '1'),(NULL,'xxx ', '1'),(NULL,'xxx ', '1'),(NULL,'xxx ', '1'),(NULL,'xxx ', '1')

Go to the top of the page
+Quote Post
mortus
post
Post #5





Grupa: Zarejestrowani
Postów: 2 178
Pomógł: 596
Dołączył: 25.09.2009
Skąd: Piwniczna-Zdrój

Ostrzeżenie: (0%)
-----


Gołym okiem widać, że masz o jeden nawias (zamykający) i apostrof za dużo. Usuń ') przed ostatnim cudzysłowem " i ma być.
Go to the top of the page
+Quote Post
emajl22
post
Post #6





Grupa: Zarejestrowani
Postów: 273
Pomógł: 21
Dołączył: 28.11.2010

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


to nie to. usunalem i to samo

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 '1')' at line 1
  1. mysql_query("INSERT INTO `sms_codes` VALUES (null, '".implode("', '$typeid'),(null,'",$fp).", '$typeid')") OR die(mysql_error());
Go to the top of the page
+Quote Post
mortus
post
Post #7





Grupa: Zarejestrowani
Postów: 2 178
Pomógł: 596
Dołączył: 25.09.2009
Skąd: Piwniczna-Zdrój

Ostrzeżenie: (0%)
-----


To to, a do tego dochodzi jeszcze brak apostrofa przed ostatnim przecinkiem. Komunikat błędu jest inny!

Swoją drogą temat już dawno powinien zostać zamknięty, bo forum to nie parser.
Poza tym skowron-line dobrze Ci radził, ale Ty chyba go nie posłuchałeś.
Go to the top of the page
+Quote Post
emajl22
post
Post #8





Grupa: Zarejestrowani
Postów: 273
Pomógł: 21
Dołączył: 28.11.2010

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


wiem ze forum to nie parser, ale stracilem na to sporo czasu i sam bym nie doszedl co jest zle
Go to the top of the page
+Quote Post

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

 



RSS Aktualny czas: 27.08.2025 - 16:21