Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> Mysql4 do Mysql5 - błąd zapytania
Benobi
post
Post #1





Grupa: Zarejestrowani
Postów: 2
Pomógł: 0
Dołączył: 6.01.2013

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


Witam,

Po migracji z mysql4 na mysql5 wystąpił problem.
Na stronie pokazuje mi się komunikat:

mysql_fetch_array(): supplied argument is not a valid MySQL result resource in ... 131

Linie 129-131:

129 | $q="select gs_hr.rin$hr as rin,gs_hr.uin$hr as uin,gs_hr.cl$hr as cl,gs_hr.out$hr as out,gs_hr.f$hr as f,gs_hr.a$hr as a,gs_hr.rin$hrl as rinhrl,gs_hr.out$hrl as outhrl,gs_hr.d as d,gs_tr.r as r,gs_tr.t as t,gs_tr.tr as tr,gs_tr.otr as otr,gs_tr.htr as htr,gs_tr.hotr as hotr,gs_tr.dowed as dowed,gs_tr.a as ca,gs_tr.drin as drin,gs_tr.dout as dout,gs_tr.etr as etr from gs_hr,gs_tr where gs_hr.d=gs_tr.d";
130 | $r=mysql_query($q);
131 | while($row=mysql_fetch_array($r)){$d=$row["d"];

Po wykonaniu echo mam informację:

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 'out,gs_hr.f4 as f,gs_hr.a4 as a,gs_hr.rin3 as rinhrl,gs_hr.out3 as outhrl,gs_hr.' at line 1

Cały plik php ma 153 linie.

Muszę to uruchomić pod mysql5 ...
Czy ktoś może mi pomóc?

Pozdrawiam,
Go to the top of the page
+Quote Post
nospor
post
Post #2





Grupa: Moderatorzy
Postów: 36 557
Pomógł: 6315
Dołączył: 27.12.2004




gs_hr.out$hr as out
OUT jest słowem zastrzeżonym w mysqql i nie możesz tworzyć aliasu o takiej nazwie. Musisz zmienić ten alias a potem w php pamiętać o tej zmianie.
Go to the top of the page
+Quote Post
mmmmmmm
post
Post #3





Grupa: Zarejestrowani
Postów: 1 421
Pomógł: 310
Dołączył: 18.04.2012

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


Spróbuj dać w grawisach.
  1. ,gs_hr.out$hr AS `out`
Może pomoże.
Go to the top of the page
+Quote Post
nospor
post
Post #4





Grupa: Moderatorzy
Postów: 36 557
Pomógł: 6315
Dołączył: 27.12.2004




Powinno pomóc (IMG:style_emoticons/default/smile.gif)
Go to the top of the page
+Quote Post
Benobi
post
Post #5





Grupa: Zarejestrowani
Postów: 2
Pomógł: 0
Dołączył: 6.01.2013

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


Bardzo dziękuję ! (IMG:style_emoticons/default/smile.gif)

Benobi
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: 23.08.2025 - 10:50