Ok, try these magic lines in your for next loop one at a time...
while ($row=mysql_fetch_array($result)){
print array_splice (implode (":", array_keys ($row) ), implode (":", array_values($row));
print "<BR>";
}
Or:
while ($row=mysql_fetch_array($result)){
print "Array keys:".implode(" ",$array_keys($row));
print "<BR>";
print "Array values:".implode(" ",array_values($row));
}
And tell us what you see.
PS, read up on all the array functions on the docs at:
ref.array.html on php documentation trees. Arrays in PHP are easily tamed with a few neat commands that show them their place.
P.s. both of those examples assumed single dimension arrays. You can write some fun functions to explore multi-dimensional arrays, even uneven ones, quickly.