Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [smarty] wyświetlanie newsów.
matyskiewicz
post
Post #1





Grupa: Zarejestrowani
Postów: 184
Pomógł: 3
Dołączył: 6.10.2006
Skąd: Poznań

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


Jak wyświetlic w smartach 5 ostatnich newsów z BD

.php
  1. <?php
  2. ...
  3. $db_table_news = mysql_query("SELECT * FROM $sql_db_news LIMIT 5") 
  4. ...
  5. while($row = mysql_fetch_array($db_table_news)) {
  6. $id_news = $row['id_news'];
  7. $title = $row['title'];
  8. }
  9. ?>


.tpl
  1. <div class="news_title"># {$title}</div>
  2. <div class="news_text_short">{$text_short}</div>


W rezultacie dostaje tylko ostatni wynik, a chciałbym otrzymać powiedzmy 5 ostatnich


--------------------
eclipse :)
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 - 09:19