looking at your line again, it should be:
$output .= "<td class=\"dbtext\"><b>$row[$i]</b></td>";
don't use $result again there
and then you probably need to put <tr> tags in your templates
or you can do following
$output .= "<tr> <td class=\"dbtext\"><b>$row[$i]</b></td>"; //$i is 0 here
$i++;
$output .= "<td class=\"dbtext\"><b>$row[$i]</b></td> </tr>"; //$i is 1 here
$i++;
just so you know, the $output is not array and doesn't need to be one, additionally arrays start from 0 and not 1
if you want to declare something as an array, you can use $blabla = array(); see
http://php.net/manual/en/language.types.array.php for details
also do some reading on php while loop and php operators