in reply to Obtaining field names only

You may just want the top loop (outside of the fetchrow_hashref) using $sth->{NAME}

--------------
It's sad that a family can be torn apart by such a such a simple thing as a pack of wild dogs