If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Unanswered: Working with smarty

Hi all
if any body knows or is working with smarty then please help me out with this problem. I am totaly exhausted with this.
Let me tell you about the senario.
I have a events table which has a lots of events for different dates. Now I want to list these events for a week. I will get the first date of the week from the user. Now to pass the values to the smarty template I am using the the follow code

$smarty->append('events_title',$row['title']);
this will store the title of the event. This perticulare code is in side the while loop that fetch the information from the DB,
like
$result=mysql_query("select * from events where date='$sdate'");
while($row=mysql_fetch_array($result))
{
$smarty->append('date',$row['date']);
$smarty->append('events_title',$row['title']);
}

This way I get the information stored in some variable which can be accessed in smarty template. But the real issue is I have all this in a for loop, b'coz the $sdate keeps on changing. The $sdate keeps on incrementing for 7 days (a week) So this become like a 2 dimensional array.
So now the code is like
for($i=0;$i<=6;$i++)
{
// $sdate gets incremented by date. I am not useing between in the query b'coz I want this to be sorted by date aswell events_priority
$result=mysql_query("select * from events where date='$sdate' order by events_priority");
while($row=mysql_fetch_array($result))
{
$smarty->append('date',$row['date']);
$smarty->append('events_title',$row['title']);
}
}

Now in the template I have done some thing like this
{section name=day loop=$sdate}
print some information
{section name=events loop=$event_title[day]}
print another information { $events_title[day][events]}
{/section}
{/section}

As per the smarty document this template is correct But still this is not working. Means the seconf section is not working.