Display array elements in smarty

ぐ巨炮叔叔 提交于 2019-12-02 07:47:26

You didn't give an example output of what you wanted, so I'll take a guess. Assuming you are looking for the following output for the array above:

0: Petric Naughton<br />
1: Nitish Dolakasharia<br />
2: Martin Rom<br />
3: Steve Wough<br />
4: Liz Hurley<br />

You'd could do this:

{foreach from=$rand_pro item=pro key=pro_key}
    {$pro_key}: {$pro.bz_pro_first_name} {$pro.bz_pro_last_name}<br />
{/foreach}

If I am assuming incorrectly, please update your question with the output you are expecting to be more clear.

ankit sharma

Use {foreach} to display array in smarty. and for database connection use ADODB.

In php file:

type $smarty->assign->("arrname",$aodDBconn->Execute($sql)).

It will work.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!