When I use that code, I get this error:
Warning: Variable passed to each() is not an array or object in /projects/sunarchive/htdocs_0_10/buildnews.php on line 23
The line in question is:
while(list($name,$val)=each($row))
Let me know what you think. Thanks.