rendered paste body while($row = $result->fetchRow(MDB2_FETCHMODE_ASSOC))
{
//$recTypes = array();
$recordElements[] = $row;
$query2 = "select rt.rectypetitle from recordType rt,rtJoin rtj
where (rt.recType_id = rtj.recType_id) and (rtj.record_id=". $row['record_id'].")";
$result2 = $connection->query($query2);
while($row2 = $result2->fetchRow(MDB2_FETCHMODE_ASSOC))
{
//$recTypes[$row['record_id']][] = $row2;
$recTypes[] = $row2;
}
$recordElements["recTypes"] = $recTypes;
}
$smarty->assign('recElements',$recordElements);
Template------
{foreach item=element from=$recElements}
<a href="/records/recordsDisplay/{$element.rec_short_description}">{$element.rec_short_description}</a>
//{$element.firstname},{$element.rec_where}
<br/>
...............................................................
<br/>
<b>
{*this is should only show results for the id passed from the outer query*}
Category:</b>
{foreach item=type from=$element.recTypes}
{$type.rectypetitle}
spin <br/>
{/foreach}
<br/>
The details are....<br/>
{$element.rec_detail_description}
<br/>
...............................................................
<br/>
{/foreach}