Elo po raz drugi tongue.gif zawital do mnie swiety mikolaj zostawiajac problem amianowicie:
KOD INDEX.PHP
  1. <?
  2. include('include/functions.php');
  3. include('../mysql.php');
  4. include('include/mysql.php');
  5. ?>
  6. <html>
  7. <head>
  8. <meta http-equiv="Content-type" content="text/html; charset=iso-8859-2">
  9. <link rel="stylesheet" href="../style.css" type="text/css">
  10.  
  11. </head>
  12. <table width="800" cellpadding="1" cellspacing="1" align="center" class="tabela2" border="0"> 
  13. <?
  14. include('include/header.php');
  15. ?>
  16. <tr>
  17. <th colspan="8" class="cat3">Town Of Laugh</th>
  18. </tr>
  19. <tr class="post">
  20. <th colspan="2">Kategoria</th>
  21. <th>Tematów</th>
  22. <th>Postów</th>
  23. <th>Ostatni Post</th>
  24. </tr>
  25. <?
  26. while($kategoria = mysql_fetch_array($kategorie)){
  27. $posty_temat = mysql_query ("SELECT * FROM forum_posty ORDER BY `ID` DESC") or die (mysql_error());
  28. $post_temat = mysql_fetch_array($posty_temat);
  29. $post_ilosc = mysql_num_rows($posty_temat);
  30. $ilosc_temat = mysql_query ("SELECT * FROM forum_tematy ") or die (mysql_error());
  31. $temat_ilosc = mysql_num_rows($ilosc_temat);
  32. <tr class=post>
  33. <th width=46><img src="images/folder_new_big.gif"></th>
  34. <th><a href=topic.php?cat='.$kategoria[0].'>'.$kategoria[1].'</a></th>
  35. <th>'.$temat_ilosc.'</th>
  36. <th>'.$post_ilosc.'</th>
  37. <th><a href=post.php?cat='.$post_temat[5].'&topic='.$post_temat[6].'>'.$post_temat[2].'</a></th>
  38. </tr>
  39. ');
  40. }
  41. ?>
  42. </table>
  43. </html>

Problem w tym, ze po utworzeniu drugiej kategorii w polu ilosc tematow i ilosc postow wyswietla ilosci z innej kategorii czyli mam dwie kategorie. w pierwsze jest 8 postow i 4 tematy a w drugiej jest po 0. do pierwszej kategorii wyswietla dobrze a do drugiej juz nie bo wyswietla z pierwszej kategorii. Ale przeciez ja jestem madry i wpadlem na pomysl aby dodac cos takiego jak WHERE `ID` = '".$kategoria[0]."' w lini 30. zaden blad nie wyskakuje ale pokazuje ze kategoria 1 ma 1 temat i kategoria 2 tez ma 1 temat. Wiec co mam zrobic aby pokazywalo dobrze?questionmark.gifquestionmark.gif?