[ic] [perl] problem

Jonathan Clark interchange-users@interchange.redhat.com
Wed Oct 24 06:24:01 2001


> [set cat_wahl]LiYv[/set]
> [scratch cat_wahl]
> [perl]
> $sql='select distinct q_leiter from products where
> category='.$Scratch->{cat_wahl};
> $set=$Db{products}->query($sql);
> 
> for(@$set) {
>      $out .= "NAME: $_->[0]<BR>";
>  }
> $out .= "First value:  $set->[0][0]<BR>";
> return $out;
> [/perl]
> 
> The strange think is when I change the row return $out; to return $sql;
> I can see the correct string:
> select distinct q_leiter from products where category=LiYv.
                                                        ^   ^
This is not correct, should be:
select distinct q_leiter from products where category='LiYv'

strings must be quoted in SQL.

Jonathan
Webmaint.