Witam, mam problem z wyświetlaniem wyników wiem że mam gdzieś błąd ale nie potrafię sobie sam poradzić. Więc tak, zapytanie poniższe działa tak :
1. Wyświetla Poprawnie dane Filmu jak zdjęcie,reżysera daty itp.
2. Wyświetla pod filmem Aktorów i role jakie grają w filmie ale z błędem :/ ponieważ jak mam przykładowo 5 aktorów to wyświetli sie 5x film a pod każdym filmem 1 aktor.
wygląda to tak :
Shrek
aktor1
Shrek
aktor2
Shrek
aktor3
itd...
A powinno być :
Shrek
aktor1
aktor2
aktor3
Może ktoś mi pomóc albo jakoś naprowadzić ?
{
$i=0;
$wynik=mysql_query("select * FROM filmy INNER JOIN role ON filmy.Id_F = role.Id_F INNER JOIN aktorzy ON role.Id_A = aktorzy.Id_A
where filmy.Id_F=$id", $idc)
or
die("Błąd podczas wykonywania zapytania");
echo"<table border = 0 bordercolor = 'BFF1FA' cellpadding=0 cellspacing=0 width=450>"; {
$foto=".\\fotki\\".$dane[8];
$foto5=".\\fotki\\".$dane[11];
$foto2=".\\fotki\\".$dane[12];
$foto3=".\\fotki\\".$dane[13];
$foto4=".\\fotki\\".$dane[14];
$foto1=".\\aktorzy\\".$dane[22];
<TD rowspan=6><img src=$foto width=150 height=220 border=0></TD>
<TD Width = 300><h2> $dane[1]<br><hr width=250 color=55819C></TD></tr><tr>
<TD Width = 300><b> Reżyser:</b><i> $dane[2]</TD></tr><tr>
<TD Width = 300><b> Data premiery:</b><i> $dane[4]</TD></tr><tr>
<TD Width = 300><b> Czas trwania:</b><i> $dane[3] min</TD></tr><tr>
<TD Width = 300><b> Dystrybucja:</b><i> $dane[6]</TD></tr><tr>
<TD Width = 300><b> Gatunek:</b><i> $dane[5]</TD></tr>
</table>
<br>
<table border = 0 bordercolor = 'BFF1FA' cellpadding=0 cellspacing=0 width=500><tr>
<TD Width = 450><b> Opis:<br><hr color=55819C></b></td></tr>";
<td>$dane[7]</TD></tr><tr>
<td><br>
<img src=$foto5 width=120 height=120 border=0>
<img src=$foto2 width=120 height=120 border=0>
<img src=$foto3 width=120 height=120 border=0>
<img src=$foto4 width=120 height=120 border=0>
</td></tr>
<tr>
<TD Width = 450><b> Obsada:<br><hr color=55819C ></b></td></tr><tr><td>";
if ($i%2)
{
$class='szary';
}
else
{
$class='bialy';
}
<table border=1> <tr class=$class><td width=35 height=40 >
<A HREF=polecamy.php?id=$dane[19]>
<img src=$foto1 width=35 height=40 vspace=0 hspace=0> </A></td>
<td align='left' valign='middle' width=200 height=35>
<A HREF=polecamy.php?id=$dane[19]>$dane[20]</A></td>
<td align='left' valign='middle' width=200 height=35><b>:</b> <i>$dane[18]</i>
</table></tr></table>
</td>
</tr>
";
$i++;
}
}
Ten post edytował sottu 5.03.2010, 20:57:13