Here is some of the code I would use:
$result = $this->query("SELECT name FROM personTab where personId=23");
$row = mysql_fetch_row($result);
$personName=$row[1];
<table>
<tr>
<td><label>Navn:</label></td>
<td><input type="text" name="personName" value="$personName"></td>
</tr>
</table>
This is not my exact code, but I hope this would be helpful. When I don't use a textfield it prints out the whole line.
Thanks T.