rendered paste body $result = $connection->query($query);
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[] = $row2;
}
$smarty->assign('recTypes',$recTypes);
}
$smarty->assign('recElements',$recordElements);
Template -- Code
{section name=official loop=$recElements}
<a href="/records/recordsDisplay/{$recElements[official].rec_short_description}">{$recElements[official].rec_short_description}</a>
//{$recElements[official].firstname},{$recElements[official].rec_where}
<br/>
...............................................................
<br/>
<b>
{*this is should only show results for the id passed from the outer query*}
Category:</b>
{section name=categories loop=$recTypes}
{$recTypes[categories].rectypetitle}
{/section}
<br/>
The details are....<br/>
{$recElements[official].rec_detail_description}
<br/>
...............................................................
<br/>
{/section}