In the part of code:
$polecenie = "SELECT osoby.Id ,osoby.Imie ,
osoby.Nazwisko, osoby.Tytul,oso by.Email,adresp raca.Adres AS ap,
adrespraca.KodP oczt AS
KodP,adrespraca .NazwaInstytucj i,adrespraca.Mi asto AS MiastP,
adrespraca.Woje wodztwo AS wojPr,adresprac a.NrTelefonu As
TelP,adresdom.A dres,adresdom.K odPoczt,
adresdom.Miasto ,adresdom.Wojew odztwo,adresdom .NrTelefonu,stu dia.Od,studia.D o,
studia.Kierunek ,studia.MiejscS tud,studia.IdUc zelni,uczelnia. NazwaUczelni
as nazwUcz FROM osoby
INNER JOIN adrespraca ON osoby.Id = adrespraca.User Id
INNER JOIN adresdom ON
osoby.Id = adresdom.UserId INNER JOIN studia ON osoby.Id
= studia.IdStuden ta INNER JOIN
uczelnia ON uczelnia.IdUcze lni = studia.IdUczeln i INNER
JOIN
wojew ON adrespraca.Woje wodztwo = wojew.IdWoj WHERE
osoby.imie='Joh n' ";
$polaczenie = mysql_connect(" 127.0.0.1", $useName, $pass);
$baza = "sample";
mysql_select_db ($baza, $polaczenie);
$result = mysql_query($po lecenie,$polacz enie);
while($wiersz = mysql_fetch_arr ay($result)){
//here I print the received data with print
($wiersz["Column_nam e"]);
}
So the problem is , that mysql_query() - function returns "Resource id
#2" as it should and after that when I call mysql_fetch_arr ay($result)
it returns nothing - every time I try to receive less than 3 results.
Variable $polaczenie is just a sample in the code, usually it is
generated by function which for sure works properly. When "SELECT"
statement should return 3 or more results, it prints everything
staring from the 3rd. When I paste the generated "Select" statement
into the command line im MySql interface it works like it should.
I have no idea where the problem is, I would be grateful for replies.
Konrad
$polecenie = "SELECT osoby.Id ,osoby.Imie ,
osoby.Nazwisko, osoby.Tytul,oso by.Email,adresp raca.Adres AS ap,
adrespraca.KodP oczt AS
KodP,adrespraca .NazwaInstytucj i,adrespraca.Mi asto AS MiastP,
adrespraca.Woje wodztwo AS wojPr,adresprac a.NrTelefonu As
TelP,adresdom.A dres,adresdom.K odPoczt,
adresdom.Miasto ,adresdom.Wojew odztwo,adresdom .NrTelefonu,stu dia.Od,studia.D o,
studia.Kierunek ,studia.MiejscS tud,studia.IdUc zelni,uczelnia. NazwaUczelni
as nazwUcz FROM osoby
INNER JOIN adrespraca ON osoby.Id = adrespraca.User Id
INNER JOIN adresdom ON
osoby.Id = adresdom.UserId INNER JOIN studia ON osoby.Id
= studia.IdStuden ta INNER JOIN
uczelnia ON uczelnia.IdUcze lni = studia.IdUczeln i INNER
JOIN
wojew ON adrespraca.Woje wodztwo = wojew.IdWoj WHERE
osoby.imie='Joh n' ";
$polaczenie = mysql_connect(" 127.0.0.1", $useName, $pass);
$baza = "sample";
mysql_select_db ($baza, $polaczenie);
$result = mysql_query($po lecenie,$polacz enie);
while($wiersz = mysql_fetch_arr ay($result)){
//here I print the received data with print
($wiersz["Column_nam e"]);
}
So the problem is , that mysql_query() - function returns "Resource id
#2" as it should and after that when I call mysql_fetch_arr ay($result)
it returns nothing - every time I try to receive less than 3 results.
Variable $polaczenie is just a sample in the code, usually it is
generated by function which for sure works properly. When "SELECT"
statement should return 3 or more results, it prints everything
staring from the 3rd. When I paste the generated "Select" statement
into the command line im MySql interface it works like it should.
I have no idea where the problem is, I would be grateful for replies.
Konrad
Comment