Hi,
Stuck a bit on Smarty
I have this:
And the tpl file:
What this does for some reason is prints out the results in a row so instead of this:
Column Title | Column Title
Count result | Count result
Count result | Count result
It does this:
Column Title | Column Title
Count result | Count result | Count result | Count result
same Count result | same Count result | same Count result | same Count result
Any ideas what I can do to fix this please?
Thanks
Craig.
Stuck a bit on Smarty

I have this:
Code:
$count = array();
$sqlcAccounts = sprintf("SELECT * FROM Accounts WHERE Category = %s", quote_smart($field['ID']));
$sqlcItems = sprintf("SELECT * FROM Items WHERE Category = %s", quote_smart($field['ID']));
$sqlcAccountsR = mysql_query($sqlcAccounts);
$sqlcItemsR = mysql_query($sqlcItems);
$count[] = array(
'count_accounts' => mysql_num_rows($sqlcAccountsR),
'count_items' => mysql_num_rows($sqlcItemsR)
);
$smarty->assign('count', $count);
And the tpl file:
Code:
{section loop=$count name=count}
<td>{$count[count].count_accounts}</td>
<td>{$count[count].count_items}</td>
{/section}
What this does for some reason is prints out the results in a row so instead of this:
Column Title | Column Title
Count result | Count result
Count result | Count result
It does this:
Column Title | Column Title
Count result | Count result | Count result | Count result
same Count result | same Count result | same Count result | same Count result
Any ideas what I can do to fix this please?
Thanks
Craig.