Witam mam nadzieje że tym razem znajdzie się ktoś kto mi pomoże (IMG:
style_emoticons/default/smile.gif) a więc konkretnie mam problem z pętlą w smarty ponieważ zamiast wyświetlać mi 5 ostatnich rekordów z tabeli wyświetla mi 5 takich samych ... ;/
fragment. plik php
$result = mysql_query("SELECT id, title, value_1, value_2, img FROM news ORDER BY id DESC") or
die("Niepoprawne zapytanie MySQL");
{
$smarty->assign("news_id" ,$news['id']);
$smarty->assign("news_title" ,$news['title']);
$smarty->assign('news_value1',$news['value_1']);
$smarty->assign('news_img',$news['img']);
}
tpl
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="clansphere.css" rel="stylesheet" type="text/css" /> <link rel="alternate" type="application/rss+xml" href="../../uploads/rss/news.xml" /> <div style="float: left; padding-left: 10px;width: 553px;"> <table cellspacing="0" cellpadding="0" style="text-align: left;"><tr><td><b><i><font color="1f1f1f" size="3" face="Arial"> AKTUALNOŚCI...
</font></i></b> <img src="templates/images/22.jpg">
<table cellspacing="0" cellpadding="0" style="text-align: left;"> {section name=news loop=5}
<tr><td><b>{$news_title}
</b> <br><img style="float: left;" border="0" src="templates/images/uploads/{$news_img}"><font face="Tahoma" size="2" color="1f1f1f">{$news_value1}
</font><td></tr> <tr ><td ><img src="templates/images/22.jpg"></td></tr>
{/section}