[Date Prev][Date Next][Thread Prev][Thread Next][Interchange by date
][Interchange by thread
]
[ic] Column-names part II -> Solved!
> This part I didn?t understand. How could I use it for example in
> this query?
> I would like to make a dynamic table that displays each column if there is
> any.
>
>
> [perl tables=osoite]
> my ($ary, $field_hash, $name_array)= $Db{osoite}->query("select * from
> osoite where ((rrka='1') or (rral='1')) order by nimi");
>
> $out .="<table><tr><td>field1</td><td>field2</td></tr>";
> foreach $line (@$ary)
> {
> my ($code,$nimi)= @$line;
> $out .="<tr>";
> $out .="<td>$code</td>";
> $out .="<td>$nimi</td>\n";
> $out .="<tr>";
> }
> $out .="</table>";
> return $out;
> [/perl]
I finally solved my problem in how to get the fieldnames out:
my ($column)= join " ", @$name_array;
did the trick :)
Regards, Rene