Section and Arrays
| From: | Pablo Fischer | Date: | Sun, 06 Apr 2003 16:21:22 +0000 |
| Subject: | Section and Arrays | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-9155@lists.php.net to get a copy of this message | ||
Hi all!
Sorry for this new mail.
I have two arrays, one its of just 1 dimension and the other, of two
dimensions. The second one (array) its linked with the first array:
$Block[] = array("title" => $row_b["name_block"],
"type" => $row_b["type_block"]);
The second one..
for($j=0; $j<$ndatas_bc; $j++) {
$row_bc = mysql_fetch_array($query_bc);
$BlockContent[$i][] = array(
"text" => $row_bc["nameurl_blockc"],
"url" => $row_bc["url_blockc"]);
}
Then after the I finish all the queries, I send them to:
$Template->assign(array("block_izq" => $Block));
$Template->assign(array("blockc_izq" => $BlockContent));
The problem I think, its with the template, its just printing the last
or the first one (Depends of my sql, DESC or ASC), here's how Im
printing:
{section name=x loop=$block_izq}
{$block_izq[x].title}
{section name=y loop=$blockc_izq}
{$blockc_izq[x][y].url}
{/section}
{/section}
And it just prints the last result of blockc_izq, any ideas? please.. I
have been looking for info, but I no good results :(.
Thanks
--
Pablo Fischer <exilion@yifan.net>