Uhhh, i think oyu might have a problem here:
above your line: while($row = @pg_fetch_array($result,0)) put this: $tick = 0;
replace while($row = @pg_fetch_array($result,0)) with while($row = @pg_fetch_array($result,$tick++))
The way you have it now, it will never stop.
and please delete all those printf("<td>$row[1]</td>"); statements! First, the first index in an array is [0], not 1, so you'll skip the first. second, this would print out each index count(array) times, not what you want.
Again, replace all of this:
while($row = @pg_fetch_array($result,0))
{
printf("<td>$row[1]</td>");
printf("<td>$row[2]</td>");
printf("<td>$row[3]</td>");
printf("<td>$row[4]</td>");
printf("<td>$row[5]</td>");
printf("<td>$row[6]</td>");
echo "</tr>";
echo "</table>";
}
whith this:
$tick = 0;
while($row = pgfetch_array($result,$tick++)) {
printf("<td>$row[donorid]</td>");
}
trust me, it'll work.