Dear Chris,

Thanks a lot.
It worked according to your suggestion.
row0 was the key and row1 the value.
Seems I was puzzled with the syntax to add to a hash

%somelabels =();
$somelabels{$row4[0]}=$row4[1];

Caio e arriverderci.

Chris Faust wrote:

> I'm not sure what this is doing, but is row4[0] your key and row4[1] your
> value?
>  seems like this:
>
>    while ((@row4) = $sth4->fetchrow_array) {
>           push @ids, "@row4[0]";
>           if ($listcounter == 0) {
>              $hashstring .= "@row4[0],'" . "@row4[1]'";
>           }
>           else {
>              $hashstring .= ",@row4[0],'" . "@row4[1]'";
>           };
>           $listcounter = $listcounter + 1;
>         };
>
> Might be better off as:
>
> %somelabels =();
>    while (@row4 = $sth4->fetchrow_array()) {
>           push(@ids,"$row4[0]");
>           if ($listcounter == 0) {
>              $somelabels{$row4[0]}=$row4[1];
>           }
>           else {
>                 #note sure why we dupe here
>                 $somelabels{$row4[0]}=$row4[1];
>           };
>           $listcounter + 1;
>         };
>
> Just a thought..
>
> -Chris
>

Reply via email to