Q:

Smarty assign variable in while loop

I have the following PHP function 
while( $manufacturer2 = xtc_db_fetch_array($manufacturer_query2,true) ){
echo $manufacturer2['manufacturers_name'] = '<a class="PI_Manufacturer"
href="'. xtc_href_link(FILENAME_DEFAULT, xtc_manufacturer_link($manufacturer2['manufacturers_id'])) . '">' . $manufacturer2['manufacturers_name'] . '</a>';
}

Right now it echoes the results but I want to assign them to a Smarty variable. I put this:
$info_smarty->assign('MANUFACTURERS',$manufacturer2['manufacturers_name']);

in the while loop but when I call my variable in the template I get only 1 name instead of 2 or 3 for example. In my templates I'm using a foreach loop to get all the values. Any suggestions?

A:

Here is how I solved this:
Created an array in the while loop and put each item in it:
while( $manufacturer2 = xtc_db_fetch_array($manufacturer_query2,true) ){
$os[] = $manufacturer2['manufacturers_name'] = '<a class="PI_Manufacturer" style="color: #990033" href="' . xtc_href_link(FILENAME_DEFAULT, xtc_manufacturer_link($manufacturer2['manufacturers_id'],$manufacturer2['manufacturers_name'])) . '">' . $manufacturer2['manufacturers_name'] . '</a><text class="PI_Manufacturer">;</text> ';
$info_smarty->assign('ALINK',$os);
}

I also assigne the array to a variable at the end and called it using a foreach loop in the template:
{foreach item=authors from=$ALINK} 
{$authors}
{/foreach}

