[ diyabolic @ 31.01.2005. 15:25 ] @
Ovako imam bazu rel_dj i u njoj 2 tabele deejay i discography.
U tabeli deejay imam kolone id, name, biogrphy genre a u discogrphy imam disc_id (id svake pesme), Albums, Released, Label i did (id koji odgovara dj-u).
Kad se konektujem na bazu i odradim sve....ne ispisuje mi prvi unos pesme kod svakog dj...
znaci prva pesma kod svakog dj je zanemarena, ispis pochinje od druge.

Code:

<?php
  $id=$_GET['id'];
  $q="select deejay.*,discography.* from deejay,discography where discography.did='$id' AND id='$id'group by Albums order by Released";
  $do=mysql_query("$q");
  $row=mysql_fetch_array($do);
  if($_GET['id']) {
  print "<table width=\"450\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
  print "<tr><td><font color=white>Name:</font></td></tr>";
  print "<tr><td><font class=big>$row[Name]</font></td></tr>";
  print "<tr><td><br><font color=white>Genre:</font></td></tr>";
  print "<tr><td><font class=big>$row[Genre]</font></td></tr>";
  print "<tr><td><br><font color=white>Biography:</font></td></tr>";
  print "<tr><td><font class=tekst>$row[Biography]</font></td></tr>";
  print "<tr><td><br><font color=white>Discography:</font><br></td></tr>";
  while($row=mysql_fetch_array($do)){  
          print "<tr><td><font class=tekst color=#005C96>$row[Albums] - $row[Label] ($row[Released])</td></tr>";   
    }
    print "<tr><td align=center><br><a href=\"addnew.php\" class=\"l\"> Add New Releases To Database</a> </td></tr>";
  print "</table>";
  } else {
       print "<br><font class=big>Click On The Name From The List To See More Information About Deejay<br><br>.:: CLubbing Culture ::.";
      }
  ?>
[ broker @ 31.01.2005. 16:09 ] @
Prvo fetch_rows koje napravis ti ode u nista. ako si tako krenuo ond anemoj korsititi while nego do - while petlju.

Code:

 $row=mysql_fetch_array($do);
 do
   { ... tvoj kod ... }
 while $row=mysql_fetch_array($do);

[ diyabolic @ 31.01.2005. 17:12 ] @
uradio...
e sad ispisuje name biogrphy i genre sve dok ima odgovarajucih pesama u tabeli..
znaci ako ima 5 pesama za svaku ce to ispisati...
ponestaje mi ideja i strpljenja
[ broker @ 01.02.2005. 10:36 ] @
U SQL upitu nemoj koristiti WHERE za povezivanje tabela nego LEFT JOIN.
[ diyabolic @ 01.02.2005. 11:03 ] @
hvala na pomoci ali sam uradio vec