Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Ostatni post
VersusPL
post
Post #1





Grupa: Zarejestrowani
Postów: 14
Pomógł: 0
Dołączył: 17.05.2010

Ostrzeżenie: (0%)
-----


Witam.
Piszę prosty skrypt forum i od jakiegoś czasu nie mogę wymyślić, jak zrobić wyświetlanie ostatniego posta na stronie głównej.
Tzn. linku do niego + nazwa.
Wygląda to na razie tak:
  1. <?php
  2. while($rows=mysql_fetch_array($result)){
  3. ?>
  4. <br />
  5. <div class="forums">
  6. <table width="92%" border="0" align="center" cellpadding="3" cellspacing="1">
  7. </table>
  8. <table class="thead" width="92%" border="0" align="center" cellpadding="5" cellspacing="1">
  9. <tr>
  10. <td width="10%" align="center"><strong>Icon</strong></td>
  11. <td width="65%" align="center"><strong>Forum</strong></td>
  12. <td width="25%" align="center"><strong>Last post</strong></td>
  13. </tr>
  14. <tr>
  15. <td align="center" class="row"><img src="images/icons/post.png" border="0" /></td>
  16. <td class="row"><a href="forum.php">Forum</a><br /></td>
  17. <td class="row"><? echo $rows['datetime']; ?><br /><a href="thread.php?id=<? echo $rows['id']; ?>"><? echo $rows['topic']; ?></a><br /></td>
  18. </tr>
  19. <tr>
  20. <td colspan="5" valign="bottom" align="right" bgcolor="#E6E6E6"><img src="images/icons/admin.png" border="0" /> <a href="admin/index.php">Administrative Control Panel</a></td>
  21. </tr>
  22. </table>
  23. <?php
  24. }
  25. ?>

No i niestety zaczyna mi wyświetlać wszystkie tematy, a chcę tylko ostatni.
Tabela tematów - forum_question.php

Proszę o pomoc.
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 21.08.2025 - 14:00