in reply to CGI Table Column Selection

while (my @row = $sth->fetchrow_array) { if($row ne 'NA'){

this is just plain wrong. @row is an array. there is no $row. why aren't you using strict and warnings? this shouldn't even compile.

you could make the database do the work and add a bunch of "where field != "NA" to your query. otherwise, you'll have to parse every field returned somehow.

Replies are listed 'Best First'.
Re: Re: CGI Table Column Selection
by devslashneil (Friar) on Jul 09, 2003 at 04:00 UTC
    Eek, thank you for that, i completly missed that, i meant $row[0].
    I am using strict and warnings in my actual code, this was just a small section of my code cut and paste into a new file to see if it works.
    Thanks for your input though although i didn't mean i wanted the data from the database, i simply wanted to know the names of the fields which contain a value other than "NA".
    Sorry if i phrased my question incorrectly.

    Neil Archibald
    - /dev/IT -