Re: [SMARTY] Using smarty to collect data in a php loop
| From: | Brian E . Lozier | Date: | Sat, 27 Apr 2002 17:43:30 +0000 |
| Subject: | Re: [SMARTY] Using smarty to collect data in a php loop | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-3908@lists.php.net to get a copy of this message | ||
You'd probably want to use a section since it's a numerical array. But your syntax is
off, you'll want to do
it like this:
$foo[] = $row[0];
4/26/02 10:06:43 PM, Gerard Samuel <gsam@trini0.org> wrote:
>Please forgive me. Im a bit new to smarty...
>Im wondering about looping through some database results to collect data
>for smarty.
>
>while ($row = mysql_fetch_row($sql)) {
> $foo = $row[0];
>}
>
>Is it possible to then pass $foo to $smarty like so
>$smarty->assign("bar", $foo);
>where $foo is a numeric array??
>And then run a foreach or the like on the array in the template.
>
>Thanks for listening...
>
>
>--
>Smarty General Mailing List (http://smarty.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
Brian