$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} {$recElements[official].rec_short_description} //{$recElements[official].firstname},{$recElements[official].rec_where}
...............................................................
{*this is should only show results for the id passed from the outer query*} Category: {section name=categories loop=$recTypes} {$recTypes[categories].rectypetitle} {/section}
The details are....
{$recElements[official].rec_detail_description}
...............................................................
{/section}