using template in a loop
techu Offline
Member
***
Posts: 154
Joined: Sep 2010
Post: #1
using template in a loop
I am trying to making a new page in mybb. I am new to this so i am not sure how to use template in a loop.

Code:
while($var = $db->fetch_array($query))
{
echo $var[gid]."<br/>";
echo $var[name];
}

The above code obviously works.. and it returns something like:

Quote:1 name
2 name2

but if I do:

Code:
while($var = $db->fetch_array($query))
{
eval("\$group_bit= \"".$templates->get("social_group_bit")."\";");
}


And the template code is:

Code:
{$var[gid]}<br/>
{$var[name]}


In this case it returns the only last value  that is:

Quote:2 name2

I am not sure how to use the templates in this case properly.

[Image: banner.png]
(This post was last modified: 04-19-2011 01:16 PM by techu.)
04-19-2011 01:16 PM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

Messages In This Thread
using template in a loop - techu - 04-19-2011 01:16 PM
RE: using template in a loop - ZiNgA BuRgA - 04-19-2011, 02:42 PM
RE: using template in a loop - techu - 04-19-2011, 04:44 PM

 Standard Tools
Forum Jump: