smarty displaying only first character from foreach
问题 I am just starting to use Smarty templates and have this very simple query: $result = mysql_query("SELECT `name`, `min_price` FROM `tblproductgroups` WHERE `hidden` != 'on' ORDER BY `order` ASC"); $data = mysql_fetch_array($result); $ca->assign('products', $data); And tempate file is like this: {foreach from=$products key=key item=product} {$product.name} - {$product.id}<br/> {/foreach} And the outcome comes out like this: V - V V - V 6 - 6 6 - 6 V is the first character for VPS (name) and 6