Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [MySQL][PHP]Dosc glupi problem
Raven1122
post 31.03.2012, 16:05:16
Post #1





Grupa: Zarejestrowani
Postów: 369
Pomógł: 2
Dołączył: 1.11.2010

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


Witam, mam 2 funkcje:
  1. function getsettings(){
  2. $sql = "SELECT * FROM arena_settings";
  3. $query = mysql_query($sql);
  4. $setting = mysql_fetch_array($query);
  5. }


Pobiera ustawienia i w 2 funkcji robie takie cos:

  1. connect();
  2. getsettings();
  3. //Ilosc wiadomosci w bazie:
  4. $sql = "SELECT * FROM arena_news";
  5. $query = mysql_query($sql) or die(mysql_error());
  6. $newsow = mysql_num_rows($query);
  7. //Ustawienia pagera
  8. $ile = $setting['displaynews'];


No i wyskakuje mi taki blad:
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 '' at line 1

Moze ktos pomoc?
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 3)
Niktoś
post 31.03.2012, 16:38:09
Post #2





Grupa: Zarejestrowani
Postów: 1 195
Pomógł: 109
Dołączył: 3.11.2011

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


Może coś nie tak w funkcji connect();?
Go to the top of the page
+Quote Post
Raven1122
post 31.03.2012, 16:40:37
Post #3





Grupa: Zarejestrowani
Postów: 369
Pomógł: 2
Dołączył: 1.11.2010

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


connect dziala bo jak usune getsettings to wyswietla newsy ;p
Go to the top of the page
+Quote Post
tolomei
post 31.03.2012, 17:09:32
Post #4





Grupa: Zarejestrowani
Postów: 450
Pomógł: 135
Dołączył: 18.11.2010
Skąd: Wschowa

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


Ja tu błędów w SQL-u nie widzę.
Wklej cały kod. Może gdzieś jest jakieś nadpisanie... ciężko powiedzieć.


--------------------
“ Computers are good at following instructions, but not at reading your mind. ”
- Donald Knuth
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: 18.07.2025 - 02:25