This is my assigned variable
{assign var="count" value=0}
I put the variable in foreach statement
{foreach from=$name item=names}
{assign var="count" value=$count+1}
{/foreach}
Want to display variable in div named "friendsCount"
<div class="friendsCount">
Total friends:{$count}
</div>
But when the program error message is displaying " Trying to get property of non-object". Please help me to find a solution. Am using codeigniter