Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: Mysql4 do Mysql5 - błąd zapytania
Forum PHP.pl > Forum > Bazy danych > MySQL
Benobi
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,
nospor
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.
mmmmmmm
Spróbuj dać w grawisach.
  1. ,gs_hr.out$hr AS `out`
Może pomoże.
nospor
Powinno pomóc smile.gif
Benobi
Bardzo dziękuję ! smile.gif

Benobi
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2024 Invision Power Services, Inc.