Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> MySQL niezrozumiały syntax error
wszerad
post 18.11.2011, 17:48:45
Post #1





Grupa: Zarejestrowani
Postów: 106
Pomógł: 18
Dołączył: 11.12.2008

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


Fragment kodu:
  1. $result = mysql_list_tables('w');
  2. for ($i = 0; $i < mysql_num_rows($result); $i++)
  3. printf ("Tabela: %s\n", mysql_tablename($result, $i));
  4. $result = mysql_query("SELECT * FROM group");

Wynikiem jest:
"ďťżTabela: group 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 'group' at line 1"

Totalnie nie wiem co tu jest nie tak i nie mogę tego złamać przez długi czas, może ktoś coś widzi?
Go to the top of the page
+Quote Post
cycofiasz
post 18.11.2011, 17:54:07
Post #2





Grupa: Zarejestrowani
Postów: 711
Pomógł: 127
Dołączył: 5.07.2008
Skąd: Łódź

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


Zamiast group daj `group`
Go to the top of the page
+Quote Post
wszerad
post 18.11.2011, 17:59:22
Post #3





Grupa: Zarejestrowani
Postów: 106
Pomógł: 18
Dołączył: 11.12.2008

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


Dobra pierwsze pudło:D Już tego próbowałem... Zmienia się aż tyle: "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 ''group'' at line 1"
Go to the top of the page
+Quote Post
cycofiasz
post 18.11.2011, 18:01:02
Post #4





Grupa: Zarejestrowani
Postów: 711
Pomógł: 127
Dołączył: 5.07.2008
Skąd: Łódź

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


To co napisałem to przepisałeś czy skopiowałeś? Jeśli to pierwsze to teraz to przekopiuj.
Go to the top of the page
+Quote Post
luckyps
post 18.11.2011, 18:03:39
Post #5





Grupa: Zarejestrowani
Postów: 153
Pomógł: 41
Dołączył: 28.06.2011
Skąd: Częstochowa

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


  1. SELECT * FROM NAZWA_SCHEMATU.GROUP
Go to the top of the page
+Quote Post
wszerad
post 18.11.2011, 18:19:02
Post #6





Grupa: Zarejestrowani
Postów: 106
Pomógł: 18
Dołączył: 11.12.2008

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


@cycofiasz
WTF! Możesz mi to jakoś wytłumaczyć?
Go to the top of the page
+Quote Post
cycofiasz
post 18.11.2011, 18:31:29
Post #7





Grupa: Zarejestrowani
Postów: 711
Pomógł: 127
Dołączył: 5.07.2008
Skąd: Łódź

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


Nazwa tabeli group jest o tyle niefortunna że jest to nazwa polecenia w sql: GROUP/group więc aby parser sql wiedział że podajesz to jako nazwę grupy a nie polecenia należy umieścić ją w tzw "Grawisie" czyli przycisk na klawiaturze nad Tab
Go to the top of the page
+Quote Post
Orzeszekk
post 19.11.2011, 00:44:40
Post #8





Grupa: Zarejestrowani
Postów: 260
Pomógł: 14
Dołączył: 8.09.2011

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


daj nazwę myGroup i po płaczu


--------------------
"The first 90 percent of the code accounts for the first 90 percent of the development time. The remaining 10 percent of the code accounts for the other 90 percent of the development time."
Tom Cargill, Bell Labs
Go to the top of the page
+Quote Post

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 Wersja Lo-Fi Aktualny czas: 14.08.2025 - 01:10