|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
bits_bytes Smarty Rookie
Joined: 14 Oct 2003 Posts: 8
|
Posted: Tue Oct 21, 2003 8:50 am Post subject: query several array in one loop |
|
|
hi!
another question from me:
It is possible to query several arrays in one loop.
Problem:
I have two arrays in an php-document and i assign them
Code: | $smarty->assign("db_templateid", $array_db_templateid);
$smarty->assign("db_templatename", $array_db_templatename); |
In my tpl-document i have an {foreach}-loop:
Code: | {foreach from=$db_templatename item=aktuelle_id}
id: {$aktuelle_id}<br>
{/foreach} |
But in this way i can only query one array.
My ambition is that i query these two arrays at the same time like this.
Code: | {foreach from=$db_templatename, db_templateid item=aktuelle_id, akt_name}
id: {$aktuelle_id}, {$akt_name}<br>
{/foreach} |
Is this way, query two arrays in one step, possible at all, or how could a solve this problem?
Thanks for your answer.
Hope you could understand my description
mfg andi |
|
Back to top |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
Posted: Tue Oct 21, 2003 9:28 am Post subject: |
|
|
you want:
Code: |
{foreach from=$db_templateid item=aktuelle_id key=no}
id: {$aktuelle_id} (same as {$db_templateid.$no} )<br>
name: {$db_templatename.$no}
{/foreach}
|
|
|
Back to top |
|
bits_bytes Smarty Rookie
Joined: 14 Oct 2003 Posts: 8
|
Posted: Tue Oct 21, 2003 9:45 am Post subject: |
|
|
i´m exalted.
This engine and your knowledge are great
thanks again |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|